I'm sorry if this question is simple but i'm new to Python and have searched around but not found my answer.
Here it is:
How do I run a .py file from the Python interpreter? I'd like to run this file: C:\Users\Myname\Desktop\Python\Python-Test.py
So far, I've:
- Downloaded Active Python (http://www.activestate.com/activepython).
- Set the PATH to open the interpreter from the Windows Command Line. The Python interpreter works fine, allowing me to print simple calculations.
Thanks for your time,
Dan.
asked Jul 9, 2013 at 10:23
user2564039
1 Answer 1
If you want to know
How do I run a .py file from the Python interpreter?
this will work
import sys
sys.path.append("C:\\Users\\Myname\\Desktop\\Python")
import Python-Test
But your question says from the command line, which has been answered in the comments.
answered Jul 9, 2013 at 10:29
doctorlove
19.4k3 gold badges49 silver badges65 bronze badges
Sign up to request clarification or add additional context in comments.
1 Comment
doctorlove
Consider ticking a answer if it helped
default
python C:\Users\Myname\Desktop\Python\Python-Test.py