taiyang2014

Python 运行 Python hello.py 出错,提示: File "<stdin>" , line 1

写了一个hello.py,仅有一句,print 'hello world',

运行 Python hello.py 出错,提示:

File "<stdin>" , line 1
python hello.py

原因是.指令不是在python环境下执行而是在shell中执行所以

退出python命令行,直接cd到hello.py所在目录,运行python hello.py,成功。

posted on 2017-03-22 16:13  taiyang2014  阅读(629)  评论(0编辑  收藏  举报

导航