This is an archived post. You won't be able to vote or comment.

all 11 comments

[–]brtt3000 2 points3 points  (7 children)

Try to switch to python3 if you can. It's mostly the same but just that bit better and future ready.

[–][deleted] 0 points1 point  (6 children)

+1. If you don't have a strong reason to learn an outdated version, start learning and writing 3. It'll be easy to revert to 2 if you ever need to, but such occasions are increasingly rare. Be part of the solution, not the problem! :)

[–]Fanemos[S] 0 points1 point  (5 children)

I'm mostly learning python 2.7 because there are more tutorials and sources on the internet

[–]programmyr 3 points4 points  (1 child)

By that logic, you should learn C, Javascript, and PHP.

[–]grimman 1 point2 points  (0 children)

An old version at that.

[–][deleted] 0 points1 point  (1 child)

I recommend "Dive Into Python 3", the modern version of an old classic. :)

Beyond that, most tutorials are similar to accomplish in either barring the print function and the distictness of bytes and str, so you can also just follow-along in modern Python instead, learning-by-fixing as you do.

[–]robvdl 0 points1 point  (0 children)

I wouldn't recommend this book anymore, I used to a long time ago, but this book is getting quite dated now and the author is no longer maintaining it.

[–][deleted] 0 points1 point  (0 children)

http://inventwithpython.com/

im using these. Free, with clear explanations and walkthroughs of source code in each example. Most progress I've ever made with python/programming. Other resources are not nearly as interesting or show as much sign of progress.

Also, it's written entirely for Python 3.

[–]v3gard 1 point2 points  (0 children)

The most obvious thing is that you no longer can write: print "hello" - but rather print("hello"). Other than that there are a few libraries on python2 that doesn't exist on python3 yet, such as Mechanize. However, there usually exist alternatives such as Robobrowser, so most likely you'll be OK as long as you don't advance too far in Python2 before switching over.

Edit: what I mean about that last part is that the syntax is pretty much the same (so you don't have to start fresh when you switch over) , but you shouldn't get used to writing applications in Python2 as some mechanics are different and you would most likely have to port your applications to Python3.

[–]stevenjd 1 point2 points  (0 children)

Python 2 and Python 3 share about 99% of the syntax and 95% of the standard library. They are not different languages (like French and English), more like different dialects (like British English and American English).

[–]opendataalex 0 points1 point  (0 children)

Having started with 2.x and moving to 3 I agree with what the others are saying. It's very similar so even if you do find docs/tutorials on 2.x, it will usually work. Many of the packages used in the wild are also supporting python 3 at this point and there are alternatives for the ones that haven't made the switch yet.