r/learnpython • • 51m ago

About running python code in terminal

Guys, I am beginner. I have the python code and have saved in file. Now I want to place the file path in the terminal and run that code. I don't know what should I write before adding the file path? Please help!

2 Upvotes

8 comments sorted by

View all comments

•

u/EszterSantos72 17m ago

Type python3 before your file path, like python3 myscript.py. On some systems just python works, but if you have both Python 2 and 3 installed, python3 makes sure you run the right version.