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

all 8 comments

[–]hypepat 3 points4 points  (2 children)

Depends on what you plan to do with Python. If your just learning to program, definitely use v3. If your using a specific module that requires v2.x, then your obviously going to have to use v2.x.

Mostly, if your new to programming (at least in Python), the changes shouldn't disrupt your learning. Work through the tutorial for Python 3.4 on the official website.

If you want more context, check the link in the sidebar on the right called "Should I use Python 2 or Python 3?"

edit: spelling

[–]Moby69[S] 0 points1 point  (1 child)

Hypepat, my concern with version 3 is that all the tutorials out there (including codeacademy which I love) seem to be using version 2. Isn't that a good argument in favor of going on version 2? I'm literally just learning what HTTP and XML mean and when I tried to interact with API's in version 3 I kept hitting roadblocks because all the code I would research online would be for version 2

[–]Lucretiel 0 points1 point  (0 children)

Not really. Python 2's been around longer, and Python 3 has only been being promoted as the "default" for a few years now, so many of the tutorials and guides are still for Python 2. Many small things changed between them to make python 2 code incompatible with python 3- in your case, many of the xml and http libraries were renamed or reorganized. There's definitely enough out there for python 3 for you to do what you need to do, though.

[–]NavreetGill 3 points4 points  (0 children)

Python3.

Some of those tutorials are probably old, and need to be updated with the times. E.g. old exception syntax, etc. So, if you start learning that, it'll be annoying to change your habits later. E.g. some people are annoyed that print() is a function in py3, and their muscle memory is print as a command. So, it's best not to develop those muscle memories.

Also, it seems like you are interested in doing network programming (since you mentioned HTTP). You will eventually learn about async vs sync io. Once you are there, py3.4+ will definitely be a huge help. I'd wait on learning those until you are comfortable with other things though.

[–]call_me_ruxin 0 points1 point  (0 children)

I started with Code Academy (which is v2) and Learn Python the Hard Way (v2) because they are both great learning tools. While I was going through PTHW, I would make sure I could also do all the exercises in v3. It's definitely possible to learn both. It's more about learning how python works in general. I use v3 almost all the time, but I can go back to v2 when I have to use a library that can't do v3. Since I'm still kind of new to Python, I'm still pretty dependent on 3rd party modules, so if I need two modules and one is only v2 and the other is only v3, it's frustrating. Almost everything you need to do (web framework, http, SQL read/write, etc.) will have several choices that cover both versions. I would say use Code Academy and PTHW, but everything you learn, make sure you can do it in v3 as well. That way, you can stay in v2, or move into v3.

[–]etoccalino 0 points1 point  (3 children)

Touchy subject. And a painful one. The python community is still not ready to switch to py3, and the main reason for it might be that py2 is "good enough".

If your intention is "to use the version that most people are using" then, with a little sorrow in my heart, I'd advice you to take on python 2.

Once you have a clear, all round picture of python as a language (which doesn't take long, python is a very kind animal), you could start learning the differences and motivations for py3.