Thursday, May 2, 2024
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 2934  / 2 Years ago, thu, february 17, 2022, 2:06:08

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?


More From » command-line

 Answers
7

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:




  1. Give execution permissions to the file entering chmod +x file.py

  2. Run the script with ./file.py



Another way is using the python interpreter:




  1. Enter python file.py



NOTE: In all commands replace file with your're file name


[#32183] Friday, February 18, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
amelican

Total Points: 162
Total Questions: 116
Total Answers: 108

Location: Guam
Member since Mon, May 29, 2023
1 Year ago
amelican questions
Sun, Aug 14, 22, 01:26, 2 Years ago
Mon, Apr 24, 23, 18:12, 1 Year ago
Wed, Apr 5, 23, 04:30, 1 Year ago
Thu, Sep 1, 22, 02:14, 2 Years ago
Mon, Sep 19, 22, 23:08, 2 Years ago
;