Just put this in the first line of your script :
#!/usr/bin/env python
Make the file executable with
chmod +x myfile.py
Execute with
./myfile.py
More Related Contents:
- open() in Python does not create a file if it doesn’t exist
- OSError: [Error 1] Operation not permitted
- How to use `subprocess` command with pipes
- Why does multiprocessing use only a single core after I import numpy?
- Is it possible to change the Environment of a parent process in Python?
- Changing file permission in Python
- Python FTP get the most recent file by date
- Python: how to kill child process(es) when parent dies?
- Access Denied page with headless Chrome on Linux while headed Chrome works on windows using Selenium through Python
- Find size and free space of the filesystem containing a given file
- Force python to use an older version of module (than what I have installed now)
- How would I build python myself from source code on Ubuntu?
- Python multiprocessing: Permission denied
- Simulating Key Press event using Python for Linux
- How to store the result of an executed shell command in a variable in python? [duplicate]
- Can Python select what network adapter when opening a socket?
- shutil.rmtree fails on Windows with ‘Access is denied’ [duplicate]
- Change default Python version from 2.4 to 2.6
- Splitting out the output of ps using Python
- How do I ‘lock the keyboard’ to prevent any more keypresses being sent on X11/Linux/Gnome?
- gunicorn command not found, but it’s in my requirements.txt
- Fetching the output of a command executed through os.system() command [duplicate]
- Python [Errno 98] Address already in use
- Uninstall python built from source?
- Pyaudio installation error – ‘command ‘gcc’ failed with exit status 1′
- how to find the owner of a file or directory in python
- Get mouse deltas using Python! (in Linux)
- How can I set the matplotlib ‘backend’?
- How to move .conda from one folder to another at the moment of creating the environment
- Ignore case in glob() on Linux