You can prepend a shebang on the first line of the script:
#!/usr/bin/env python
This will tell your current shell which command to feed the script into.
More Related Contents:
- ‘yes’ reporting error with subprocess communicate()
- Executing multi-line statements in the one-line command-line
- Run multiple python scripts concurrently
- Run Python script at startup in Ubuntu
- Linux command-line call not returning what it should from os.system?
- Call Python script from bash with argument
- How to make a python, command-line program autocomplete arbitrary things NOT interpreter
- Understanding python subprocess.check_output’s first argument and shell=True [duplicate]
- How to store the result of an executed shell command in a variable in python? [duplicate]
- Change working directory in shell with a python script
- How to run a python script from IDLE interactive shell?
- run a python script in terminal without the python command
- Command line execution in different folder
- ImageMagick not authorized to convert PDF to an image
- Pycharm and sys.argv arguments
- Pass input/variables to command/script over SSH using Python Paramiko
- os.makedirs doesn’t understand “~” in my path
- What’s the best way to parse command line arguments? [closed]
- How do I activate a virtualenv inside PyCharm’s terminal?
- Execute a file with arguments in Python shell
- How to activate virtualenv in Linux?
- standard_init_linux.go:178: exec user process caused “exec format error”
- Cross-platform subprocess with hidden window
- How do I get monotonic time durations in python?
- Checking for interactive shell in a Python script
- How to plot a chart in the terminal
- Listing available devices in python-opencv
- Cron job: how to run a script that requires to open display?
- What is different between makedirs and mkdir of os?
- How can I process command line arguments in Python? [duplicate]