Using Python3.3
Trying to run a script from python command line. Need to run this from python command line instead of windows command line because of some encoding format issue. But I am getting below error:
>>> python Start.py
File "<stdin>", line 1
python Start.py
^
SyntaxError: invalid syntax
I think I am already within Python so the above is invalid. I tried execfile but that doesn't help either.
Can anyone please help?
EDIT
The problem with running the script from python command line is solved. Although that doesn't solve the original encoding issue. See the thread here Changing the preferred encoding for Windows7 command prompt
import Start.pybut note that the second method won't work if you haveif __name__ == '__main__': ...__main__if you useexecfile()though. Except that's no longer available in Python 3. Ahem.subprocessmodule specially if you need to provide commandline arguments to your python script.