For CRON schedule that I am trying to run a .py file... Does the shebang at the top of a .py file need to state the version of python?
If I need Python 3, should this be:
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It only takes a minute to sign up.Sign up to join this community
Yes. At least for now you need to specify either
At some point,
python a.k.a Python ver 2.7.16 may be deprecated, and removed from the Raspbian distribution. But when this will happen has been the subject of speculation for some time.
python is version 2, and may be determined as follows:
$ python -V Python 2.7.16
This, as reported on my Raspbian
python3 is the newer version of Python; its version determined as follows:
$ python3 -V Python 3.7.3
And they are literally two separate binaries on your system:
$ which python /usr/bin/python $ which python3 /usr/bin/python3