Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python version on Linux
#6
that line is called shebang. It is used only when you want to execute your script from command prompt without using python command in front of it. For that you need to make it executable.
In IDLE it doesn't matter.
you can see https://www.python.org/dev/peps/pep-0394/ for some recommendations what shebang to use.
also https://stackoverflow.com/q/6908143/4046632
For time being you can safely leave your scripts without one. I personally prefer to explicitly invoke the respective python and almost never use shebang
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
Python version on Linux - by whois1230 - Apr-09-2020, 01:07 PM
RE: Python version on Linux - by buran - Apr-09-2020, 01:22 PM
RE: Python version on Linux - by whois1230 - Apr-10-2020, 06:54 PM
RE: Python version on Linux - by buran - Apr-10-2020, 06:57 PM
RE: Python version on Linux - by whois1230 - Apr-10-2020, 07:01 PM
RE: Python version on Linux - by buran - Apr-10-2020, 07:12 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Is possible to run the python command to call python script on linux? cuten222 6 738 Jan-30-2024, 09:05 PM
Last Post: DeaD_EyE
  run part of a script with a different version of Python jdog 2 463 Jan-09-2024, 08:49 PM
Last Post: jdog
  How to find out from outside Python (in Windows) the current version of Python? pstein 4 756 Oct-04-2023, 10:01 AM
Last Post: snippsat
  How to resolve version conflicts in Python? taeefnajib 0 940 Apr-27-2023, 08:37 PM
Last Post: taeefnajib
  Python venv and PIP version issue JanOlvegg 2 1,281 Feb-22-2023, 02:22 AM
Last Post: JanOlvegg
  Python Version upgrade nitinkukreja 1 914 Feb-04-2023, 10:27 PM
Last Post: Larz60+
  Can't update new python version on Pycharm GOKUUUU 6 3,878 Jul-23-2022, 09:24 PM
Last Post: GOKUUUU
  How to use a variable in linux command in python code? ilknurg 2 1,614 Mar-14-2022, 07:21 AM
Last Post: ndc85430
  Building python (3.9.5) with different libexpat version (2.4.6) raghupcr 0 1,321 Feb-25-2022, 11:29 AM
Last Post: raghupcr
  Python keeps running the old version of the code quest 2 3,791 Jan-20-2022, 07:34 AM
Last Post: ThiefOfTime

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020