3 ms·
sys.version_info I'm not sure why this guy is doing it the hard way.
by eloff 4y ago
sys.version_info
I'm not sure why this guy is doing it the hard way.
- Iv 4y agoBecause, as mentioned several times in this discussion, if you give a python3 file to a python2 interpreter, you will get a SyntaxError even before the first line of the script runs. This is a way o ensuring the correct python version is used and to display a clear error message next to it.