I have a script that should only be run with Python 3. I want to give a nice error message saying that this script should not be run with python2 if a user tries to run it with Python 2.x
How do I do this? When I try checking the Python version, it still throws an error, as Python parses the whole file before executing my if
condition.
If possible, I'd rather not make another script.