ToXIcGaming
Posts: 18
Joined: Fri Aug 22, 2014 5:25 pm

Python 2 or 3?

Tue Feb 20, 2018 7:52 pm

So I have some scripts and am wondering if i should update them to use Python 3 as this would be better for the future?

gordon77
Posts: 4179
Joined: Sun Aug 05, 2012 3:12 pm

Re: Python 2 or 3?

Tue Feb 20, 2018 8:22 pm

Probably. Why not make them work with both?

jahboater
Posts: 4696
Joined: Wed Feb 04, 2015 6:38 pm

Re: Python 2 or 3?

Tue Feb 20, 2018 8:27 pm

ToXIcGaming wrote:
Tue Feb 20, 2018 7:52 pm
So I have some scripts and am wondering if i should update them to use Python 3 as this would be better for the future?
Python 3
See this on the Python home, 2.7 will be the last ever 2.x version.
https://docs.python.org/2/whatsnew/2.7.html
Who wants to code in a deprecated language?

User avatar
bensimmo
Posts: 4178
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Python 2 or 3?

Tue Feb 20, 2018 9:12 pm

I know a lot of people say Python3 is slower.
I was reading a Twitter post (Facebook or similar) recently.of a large company who had moved.from Python3 from their Python 2.7 code.
The increase in speed and drop in memory usage was quite large.
Wish I could use Twitter better to actually find it useful and find a post again 10 mins later.
(While simple benchmarks for small code can be shown to be slower for Python3)

Anyway, move to Python3. Why not, may as well take advantage of any improvements they bring. Even Debian are doing it, the Stretch update from Jessie includes a lot of Python code having been updated to Python3.

ToXIcGaming
Posts: 18
Joined: Fri Aug 22, 2014 5:25 pm

Re: Python 2 or 3?

Tue Feb 20, 2018 9:52 pm

I ran my code with Python3 and after installing all the modules for Python3, it works great, thanks guys :)

User avatar
rados-dataplicity
Posts: 40
Joined: Wed Aug 03, 2016 11:56 am
Location: UK
Contact: Website Facebook Twitter

Re: Python 2 or 3?

Wed Feb 21, 2018 10:23 am

Python2 is going to be dead soon so definitely Python3
I tinker around with Raspberry Pis daily and make sure that people can easily access theirs remotely.

Community outreach @ dataplicity.com

Return to “Python”