"upasara wulung" <upasara.wulung.1...@gmail.com> wrote:
(1) In a certain working folder, I produced simple python file, for an
example, hello.py, which is free of error.
(2) I called python from the same working folder using command 'python'
(3) In the python shell, I executed: >>> run hello.py
But I got only an error message: SyntaxError: invalid syntax.
The "SyntaxError: invalid syntax" message occurs because there is
no "run" command in python. Run the python file from the command
prompt like this:
python hello.py
Alternatively, start python and then enter this at the python
prompt (>>>):
import hello
The import command loads the python file and executes the code in
the file. Note that you use "hello" and not "hello.py".
--
Michael
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor