Notifications
Clear all

Python 2.7 or 3.9

5 Posts
3 Users
0 Likes
810 Views
fredhunt
(@fredhunt)
New Member
Joined: 1 year ago
Posts: 4
Topic starter  

Somewhere in my readings/video watching, it said that the Raspberry Pi used Python 2.7.  The latest version of Python is 3.9.  Which version should a person new to Python programming (like me) learn?

Thanks.

Fred


   
Quote
DaveE
(@davee)
Prominent Member
Joined: 2 years ago
Posts: 681
 

Hi @fredhunt,

   As a 'lightweight' myself on Python, others with more Python background may offer more insight, but my impression is Python 3.x is the logical path if you are looking forwards generally.

Part of Python's charm is the huge amount of libraries and support, but this has meant that updating them all is a massive and extended process. I would only consider Python 2.x if there is a particular library or tool that you need for your 'project' that hasn't been migrated to 3.x

Python support on 'general purpose' computers, including Raspberry Pi, is hosted by the operating system rather than directly by the hardware. I think you will generally find both versions are supported. Others may be able to point to any significant exceptions.


   
ReplyQuote
b
 b
(@b)
Prominent Member
Joined: 3 years ago
Posts: 912
 

@fredhunt

rpi os has python 3.7 and will be updated to 3.9 or greater when the next debian release comes out.  If you want you can install 3.9 for yourself on the rpi if desired.  The rpi does also have 2.7 but I guess that might be dropped in future rpi os realeses

I would recommend you dont bother learning 2.7, its officially at the end of its life and as from jan 1 2020 it is no longer maintained.  And if you want to play with micropython, then thats currently based on python 3.6.  Python 2.7 and 3.x are sufficiently different that trying to lean both would be a PITA


   
ReplyQuote
fredhunt
(@fredhunt)
New Member
Joined: 1 year ago
Posts: 4
Topic starter  

@byron, Thank you for the advice.  I have downloaded Python 3.9 and have started going through Python Crash Course, 2nd edition, by Eric Matthes.  That book is based on Python 3.6. 

It is going to take me a while to get proficient with Python 3.9.  Trying to learn to work with both "flavors" of Python would be a real pain!


   
ReplyQuote
fredhunt
(@fredhunt)
New Member
Joined: 1 year ago
Posts: 4
Topic starter  

@davee, Thank you for your response.  It helped me to make the decision to focus on learning Python 3.9.


   
ReplyQuote