第⼀个Python程序hello.py提⽰出现Filestdin,line1错误syntaxerror是什么错误
写第⼀个Python程序hello.py,内容仅有⼀句,print 'hello world',
运⾏  hello.py 出错,提⽰:
File "<stdin>" , line 1
python hello.py
SyntaxError:invalid syntax
原因:
在shell脚本中,运⾏shell脚本命令;在Python命令⾏中,运⾏Python代码。然⽽,“python hello.py”是⼀个脚本命令,不是python代码。
因此,退出python命令⾏,直接cd到hello.py所在⽬录,运⾏python hello.py,即可。
若是⾮要在python命令⾏中运⾏,输⼊print("hello world")即可。