一、第一个python报错
File "<stdin>", line 1
python hello.py
SyntaxError: invalid syntax
原因:在shell脚本中,运行shell脚本命令;在Python命令行中,运行Python代码。然而,“python hello.py”是一个脚本命令,不是python代码。
本文共 217 字,大约阅读时间需要 1 分钟。
一、第一个python报错
File "<stdin>", line 1
python hello.py
SyntaxError: invalid syntax
原因:在shell脚本中,运行shell脚本命令;在Python命令行中,运行Python代码。然而,“python hello.py”是一个脚本命令,不是python代码。
转载于:https://my.oschina.net/huibaifa/blog/1814019