Reputation: 349
I am a Java
developer with more than 10 years of experience.
I started using python
few months back when I had a requirement to create a script which pulls data from a REST service and then generates a report using this data. The fact that python
is a multi purpose language (scripting, web applications, REST services etc) coupled with very fast development speed has ignited a deep interested of mine in this language. In fact this is the only language I use when I am in Linux
world.
Currently I am trying to port my (powershell/shell)
automation scripts, developed for fully automating release process of Piston (an open source Java based micro portal technology), to python
. However a major challenge in front of me is which version (2 or 3) of python
should I use? Ideally I would prefer 3 as I believe this has many improvements over version 2 and I would like to use this version of all the new development. However my concern is there could be some packages which may not a version for python 3 yet. This is what has been mentioned on python.org site too -
However, there are some key issues that may require you to use Python 2 rather than Python 3.
Firstly, if you're deploying to an environment you don't control, that may impose a specific version, rather than allowing you a free selection from the available versions. Secondly, if you want to use a specific third party package or utility that doesn't yet have a released version that is compatible with Python 3, and porting that package is a non-trivial task, you may choose to use Python 2 in order to retain access to that package.
One popular module that don't yet support Python 3 is Twisted (for networking and other applications). Most actively maintained libraries have people working on 3.x support. For some libraries, it's more of a priority than others: Twisted, for example, is mostly focused on production servers, where supporting older versions of Python is important, let alone supporting a new version that includes major changes to the language. (Twisted is a prime example of a major package where porting to 3.x is far from trivial.)
So I don't want to be in a situation where there is a package which I think can be very useful for my automation scripts but does not have a version for python
3.
Upvotes: 0
Views: 121
Reputation: 32898
Python 2 will be retired in January 2020 (see also this pull request), thus making the move to Python 3 particularly important.
Upvotes: 0
Reputation: 569
I would invite you to start with Python 3. Almost all of what you write in 3 can be written in 2, but not the other way around, most packages support 3 now and you will have skills others in Python might not (e.g. async io). Python 3 also address the problem with text and binary data from the previous versions (read more here ).
Upvotes: 0
Reputation: 3072
use python 3. the number of packages that don't support python 3 is shrinking every day, and the vast majority of large/important frameworks out there already support both. there are even some projects which have dropped python 2 entirely, albeit those tend not to be large (since enterprise inertia tends to hold projects back).
starting a new project today on python 2, especially as a beginner, is just opening yourself to more pain imo than running into a package that doesn't support python 3.
considering the versatility of python and the size of the vibrant python community, there are often multiple packages that solve the same problem. that means even if you find one that doesn't support python 3, it's often possible to find a similar project that does support python 3.
once you get confident enough w/python 3, and you do run into a package that only supports python 2, you always have the source and can start contributing patches back! :D
Upvotes: 1