I got this when I tried to open a .py
file on the terminal line I edited in pico:
lightning@rigel5:~$ ./hello.py
bash: ./hello.py: Permission denied
How can I easily open a .py
file from the pico editor in the terminal and run it in the python interpreter?
How to open the file with Pico:
In the terminal enter
pico file
where file is the path and the name of the file that you're trying to open with the editor.How to run the python script from terminal:
There are a couples of ways to do it, one of them is:
chmod +x file.py
./file.py
Another way is using the python interpreter:
python file.py
NOTE: In all commands replace file with your're file name
if your file is in home, use