r/learnpython • • 4h 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!

4 Upvotes

16 comments sorted by

View all comments

1

u/PonkMcSquiggles 4h ago

Assuming that you have Python installed and in your path, the command for running a Python file is just

python [path to file]

1

u/South-Put-7948 3h ago

Thank you so much It worked. I realized that my box folder wasen't synced thats why the file wasn't running in the terminal, but it got fixed.