Python Forum
Python 2.x or Python 3.x - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: General (https://python-forum.io/forum-1.html)
+--- Forum: News and Discussions (https://python-forum.io/forum-31.html)
+--- Thread: Python 2.x or Python 3.x (/thread-5558.html)

Pages: 1 2


Python 2.x or Python 3.x - phread - Oct-10-2017

I'm sure this discussion is in here somewhere, but I haven't found it. I'm learning Python and have seen a lot of older discussions about why it's a better idea to start with the 2.x version because of the libraries and documentation available. However 3.x has been out for a while, do you feel it's caught up and I should start with 3.x or stick with 2.x.
I've seen arguments for both, but I also have books written circa 2015 and they were still saying to use 2.7x. Are these old school guys that are just comfortable with how they learned it, or do I get used to print()?

Opinions?
Thanks!


RE: Python 2.x or Python 3.x - wavic - Oct-10-2017

Hello!
You didn't find such a discussion here because there isn't any. A few years ago - maybe. A huge amount of libraries are ported to version 3 and there is no reason to start with Python 2.x. I did it because of a book I have followed and it did bring me nothing than the basics. If you start with Python now go ahead with Python 3. 2.x is the past, 3 is the future then 4. It's good to know the differences but that's it.


RE: Python 2.x or Python 3.x - phread - Oct-10-2017

Well, there I have it. Thanks a lot!


RE: Python 2.x or Python 3.x - ichabod801 - Oct-10-2017

To find the discussion around here, just wait for a newbie to post code in 2.7. Everyone will immediately chime in telling them they should use 3.6.

I think the question here would be to f-string or not.


RE: Python 2.x or Python 3.x - nilamo - Oct-10-2017

Using 2.x was relevant years ago when 3.x was still new, and didn't have many libraries that supported it.  Now, though, there's only one reason to use 2.x, and that's if you have a legacy codebase you need to support.  If you're new, you should be 3.x 100% of the time.  Any books that teach how to program via 2.x should be used for your backyard compost pile.


RE: Python 2.x or Python 3.x - wavic - Oct-10-2017

Well, out of the topic I should say that I have used f'strings' only for the last script I wrote. I keep using str.format because I have Ubuntu on the other partition which comes with Python 3.5.2. Also, when I want to share something some people could face some obstacles if I use the new strings.


RE: Python 2.x or Python 3.x - phread - Oct-10-2017

So I think I'm getting a pretty good general consensus here. ;)


RE: Python 2.x or Python 3.x - Larz60+ - Oct-10-2017

I don't write code in DiBOL or python 2.7


RE: Python 2.x or Python 3.x - phread - Oct-10-2017

(Oct-10-2017, 07:43 PM)nilamo Wrote: Any books that teach how to program via 2.x should be used for your backyard compost pile.

Ha! Well damn you No Starch Press!


RE: Python 2.x or Python 3.x - metulburr - Oct-10-2017

python2.x most likely will not be supported in a couple years
https://pythonclock.org/