I personally prefer the 3 syntax over 2,
but I notice most of the code snippets in this forum are for Python 2.

Is it because we are still in a steady transition from 2 to 3, or is it something else?

I for one, am waiting for more 3rd party modules to switch over to 3.X. Then I will start using 3.X more

Same reason. Most existing modules are for python 2. I prefer python 3, but I 'm using python 2.

Edited 6 Years Ago by Gribouillis: n/a

The Python world is going through a transition. I do more and more work with Python 3.1.2, but still use Python 2.6.5 for some stuff.

Most folks are waiting for wxPython and PIL to make the transition. In the mean time I am using the PyQT GUI toolkit and the newer version of Tkinter that ships with Python31

I'm still using 2.6, but I have the newest 3 installed. I don't use 3, because there aren't many modules made for it. However, I do try and use 3's syntax in 2.6 where applicable (ie print("") not print ""). I do wish that I could do one liner "for" statements with Python, but I guess that'll have to wait xP

I'm still using 2.6, but I have the newest 3 installed. I don't use 3, because there aren't many modules made for it. However, I do try and use 3's syntax in 2.6 where applicable (ie print("") not print ""). I do wish that I could do one liner "for" statements with Python, but I guess that'll have to wait xP

You can also use from __future__ import print_function .

I use python 2.6 :-)

This version i look on study, so i use this version ;) I hear, many modules dosen't work in python 3.x

My english suck ;d

Get used to Python3. Where the difference between Python2 and Python3 hits you hard, is in unicode applications and the fact that many functions expect and return byte strings rather than strings.

@ Vegaseat:
What is the difference between a byte string and a string?

----------------------------------
python 2        |   python 3
----------------------------------
string          |   byte string
unicode string  |   string
----------------------------------

I don't understand? So something like this in python 2: print("Hello") is a string in 2, and a byte string in 3;
while print(u"Hello") is a unicode string in 2, and a string in 3?

I don't understand? So something like this in python 2: print("Hello") is a string in 2, and a byte string in 3;
while print(u"Hello") is a unicode string in 2, and a string in 3?

no, "hello" has type 'str' in python 3 but it is a unicode string. On the other hand, b"hello" has type 'bytes' and it's a sequence of bytes (what we called a string in python 2).
The idea is that everything is unicode by default in py 3. There is no 'unicode' type.

Edited 6 Years Ago by Gribouillis: n/a

I'm so confused. So only the technical names change, correct? I never really learned about "types" or anything. I've been programming an making full-blown applications without learning that kind of stuff. So do I have to learn it now?

I'm so confused. So only the technical names change, correct? I never really learned about "types" or anything. I've been programming an making full-blown applications without learning that kind of stuff. So do I have to learn it now?

It's a good idea to learn about types, but in this case, the important point is to understand the difference between an array of bytes and a unicode string. A unicode string is an abstraction with theoretical characters, an array of bytes is raw memory with short integer values.

Ah okay. I think i understand. What I meant was that I didn't really study types. I get the gist, like str, unsigned int, etc. Just what you said was a bit confusing xP Thank you

This question has already been answered. Start a new discussion instead.