shell脚本命令运⾏python⽂件python命令⾏运⾏python代码单独的python⽂件运⾏的时候报错:
在shell脚本中,运⾏shell脚本命令;在Python命令⾏中,运⾏Python代码。然⽽,“python hello.py”是⼀个脚本命令,不是python代码。
因此,退出python命令⾏,直接cd到hello.py所在⽬录,运⾏python hello.py,即可。
若是⾮要在python命令⾏中运⾏,输⼊print("hello world")即可。
总结:
shell脚本命令⾥直接运⾏python⽂件
python能在手机上运行吗python命令⾏运⾏单独的python代码