Hack Forums
[Python] Python 2 diff to python 3 Help! - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Python] Python 2 diff to python 3 Help! (/showthread.php?tid=5101451)



Python 2 diff to python 3 Help! - Pr0m3s - Dec 20, 2015

Hello world,

So I am about to grab a book for learning how to use python for "Hacking" I.E. Packet manipulation, exploit building, etc But the book is in python 2 and I know python 3. is there that much of a difference between the 2 and what are the differences? is it to much of a differences that I will not be able to follow along? Thank you for any help you can give me.

-Pr0me3s

I would just like to add. could I follow along in python 3?


* - Feanor - Dec 20, 2015

Not much difference but you want to be using python2 anyway. Don't use python 3.


* - NON- - Dec 20, 2015

I would see this article: https://wiki.python.org/moin/Python2orPython3

Overall, I think it would be better for you to stick with 3 unless you have a specific reason to go back to 2. 2 will be support for a very long time to come but eventually it'll be swept up by the sands of change. In any case, if you're using Linux, you'll have both installed anyway.

There's a lot of differences. I personally find the change too awkward to handle so always return to 2 because I know it. Depends how you feel about that. Of course, you could always buy a reference book for 3 specifically.


* - Socrates - Dec 20, 2015

(Dec 20, 2015 09:44 AM)Feanor Wrote:  Not much difference but you want to be using python2 anyway. Don't use python 3.

Worst suggestion ive ever fucking seen on this forum


* - NON- - Dec 20, 2015

He's not entirely wrong. Larger module support along with simpler syntax, to existing Python users who aren't level-headed and are biased, Python 2 is the superior out of the two.


* - Feanor - Dec 21, 2015

(Dec 20, 2015 10:44 PM)Socrates Wrote:  Worst suggestion ive ever fucking seen on this forum
That's cute, I bet you learnt python from sentdex and you still use idle.👍


* - CocoaNut - Dec 21, 2015

There are small differences, nothing to worry about imo. Example is printing. In python 3 you must surround the string or whatever you're printing with parentheses.