I'm looking at some Python scripts on GitHub, but the developer doesn't specify what version (2.7 or 3.x) of Python is required.
Is there any way to tell? What type of execution errors should I look out for when a Python script fails due to version mismatch?
A version mismatch between Python 2 and 3 is fairly simple to find.
In python 2, print
is used without brackets, for example: print "hello"
While in python 3, print
is used with brackets, such as: print("hello")
Python also frequently has easy-to-read errors for differences in such where the error would end with did you mean X?
Also to input something in the command line, python 2 uses raw_input
while python 3 uses input
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With