I am a programming (and Python) novice. I am unable to run any python script in command prompt of my WinXP 64-bit laptop. I assigned the path and confirmed it by typing set path. I have Python32. I get the following message:
>>>python hello.py
File <”stdin”> , Line1
Python hello.py
^
SyntaxError: Invalid syntax
Following is the script I tried:
#!/usr/bin/python
message = "Hello, world!"
print(message)
You should type this
python hello.py
at the dos/cmd prompt, not inside the Python Interpreter
Do it like this:
Go the directory(python32 in my example) and type python hello.py
.
If you only type python
in cmd then it'll launch the python interpreter after that python hello.py
will return Syntax error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With