Running a python file from current location to another one?

1699 views python
3

I am new in Ubuntu :) By using Terminal now i am on particular location and i want to run a python file that found in another location ? what the correct command to run this file in the current location? Thanks in advance

answered question

1 Answer

0

Use the complete file path, just:

python /home/user/this/is/an/example/main.py

If you are not sure where the file is, open a terminal window in its location and type pwd, this will give you the current directory

posted this

Have an answer?

JD

Please login first before posting an answer.