If I have code that uses 3.4 in the shebang line or other references to 3.4 like in a subprocess call but I'm now using python3.7, do I have to change the wording from 3.4 to 3.7?
!#/usr/bin/env python3.4 or subprocess.call("sudo python3.4 script.py") ok?
I would guess it's alright but pays to ask. thanks.
Re: 3.4 to 3.7 -- new shebang etc?
If you specifically call it with python3.4 then yes*, you'll need to change that to python3.7 to use python3.7. Normally, unless you have a specific need to target a particular sub-version, you'd just use python3 which is usually a symlink to whichever revision you have as your main python3.
You'll need to make sure that any modules your program depends on are also installed for 3.7.
*Whilst you could make python3.4 be a symlink to python3.7 it wouldn't be advisable.
You'll need to make sure that any modules your program depends on are also installed for 3.7.
*Whilst you could make python3.4 be a symlink to python3.7 it wouldn't be advisable.
She who travels light — forgot something.
Please note that my name doesn't start with the @ character so can people please stop writing it as if it does!
Please note that my name doesn't start with the @ character so can people please stop writing it as if it does!
-
- Posts: 7545
- Joined: Sat Jan 12, 2013 3:01 am
- Location: Grants Pass, OR, USA
- Contact: Website
Re: 3.4 to 3.7 -- new shebang etc?
As long as only one 3.x version is installed then I would just use:mmkw43 wrote: ↑Tue Dec 08, 2020 5:30 pmIf I have code that uses 3.4 in the shebang line or other references to 3.4 like in a subprocess call but I'm now using python3.7, do I have to change the wording from 3.4 to 3.7?
!#/usr/bin/env python3.4 or subprocess.call("sudo python3.4 script.py") ok?
I would guess it's alright but pays to ask. thanks.
Code: Select all
#!/usr/bin/env python3
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.