Just make sure the python executable is in your PATH environment variable then add in your script
python path/to/the/python_script.py
Details:
- In the file job.sh, put this
#!/bin/sh python python_script.py
- Execute this command to make the script runnable for you :
chmod u+x job.sh - Run it :
./job.sh
Videos
Just make sure the python executable is in your PATH environment variable then add in your script
python path/to/the/python_script.py
Details:
- In the file job.sh, put this
#!/bin/sh python python_script.py
- Execute this command to make the script runnable for you :
chmod u+x job.sh - Run it :
./job.sh
Method 1 - Create a shell script:
Suppose you have a python file hello.py
Create a file called job.sh that contains
#!/bin/bash
python hello.py
mark it executable using
$ chmod +x job.sh
then run it
$ ./job.sh
Method 2 (BETTER) - Make the python itself run from shell:
Modify your script hello.py and add this as the first line
#!/usr/bin/env python
mark it executable using
$ chmod +x hello.py
then run it
$ ./hello.py
Most online python interpreters suck because they try to be complete IDEs with bloated designs and none of them work on mobile.
I spent the coronavirus lockdown time building a simple python interpreter that doesn't suck, has a simple design and works on mobile. It also has a nifty dark mode feature.
I would appreciate any feedback on the tool - in terms of UI/UX, security, packages, feature requests and I would be happy to answer any questions regarding how I built it.
https://www.programiz.com/python-programming/online-compiler/