Hack Forums
[Python] need help executing py program (super noob) - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Python] need help executing py program (super noob) (/showthread.php?tid=6182025)



need help executing py program (super noob) - Killua. - Nov 21, 2021

I've had a program coded in py, just need help running it, sorry in advance, i feel like I'm asking the equivalent of "how do you turn a car on".


RE: need help executing py program (super noob) - Djangoo - Nov 22, 2021

I will help you, send me a dm


RE: need help executing py program (super noob) - Apricus - Nov 22, 2021

Navigate to the directory that has your program file using cd and then run python3 filename.py


RE: need help executing py program (super noob) - nniks1999 - Nov 26, 2021

If you use older version of python (2.x) navigate to the directory where file is and write
Code
python [filename].py
If you use newer versions of python (3.x) navigate to the directory where file is and write:
Code
python3 [filename].py

Navigation through directories should be same in most of the terminals. It is:
Code
cd directory_path
Or if you miss one directory and you want go back to previous one:
Code
cd ..