写了一个hello.py,运行出错,提示 File "<stdin>" , line 1
来源:互联网 发布:深圳网络教育机构 编辑:程序博客网 时间:2024/04/26 03:19
写了一个hello.py,仅有一句,print 'hello world',
运行 python hello.py 出错,提示:
File "<stdin>" , line 1
python hello.py
解释:
In the shell you can run shell commands, in the Python command line you can run Python code.
"python hello.py" is a shell command, not Python code, so you should run it in the shell, but not on the Python command line.
"print "hello"" is Python code, so you can run it on the Python command line, but not in the shell.
故,退出python命令行,直接cd到hello.py所在目录,运行python hello.py,成功。
初学者有用 转自:http://blog.csdn.net/scorpiomiracle/article/details/8285944
0 0
- 写了一个hello.py,运行出错,提示 File "<stdin>" , line 1
- 写了一个hello.py,运行出错,提示 File "<stdin>" , line 1
- 运行hello.py出错,提示 File "<stdin>" , line 1
- Python学习第一个程序:python第一个程序hello.py提示出现File "<stdin>",line 1错误
- File "<stdin>" , line 1 错误
- python print'hello' File "<stdin>",line 1 print 'hello' SyntaxError:invalid syntax
- python print'hello' File "<stdin>",line 1 print 'hello' SyntaxError:invalid syntax
- python {File "<stdin>", line 1} error
- File "<stdin>", line 1 pip install XXXXX ^ SyntaxError: invalid syntax
- Python---File "<stdin>", line 1 SyntaxError: invalid syntax
- 利用Yii写了一个Hello World.
- MFC 写了一个Hello MFC
- 写了一个贴图的程序,程序运行后出现错误 :unknown dib file format
- 运行python程序时出现错误“SyntaxError: Non-ASCII character '\xe8' in file variable.py on line 1, but no encod”
- apk运行出错 Error: java.lang.RuntimeException: Binary XML file line #
- 运行程序,首次运行出现“File{"<stdin>".line1,error}
- sys:1: DeprecationWarning: Non-ASCII character '\xe6' in file 0730.py on line 2
- File "/Volumes/android/.repo/repo/main.py", line 531, in <module> _Main(sys.argv[1:]) 解决方法
- CODE[VS] 1014 装箱问题
- 初写Shell脚本错误记录
- 预编译之__LINE__和__FILE__宏
- 2016/03/08
- WPF Storyboard动画停止
- 写了一个hello.py,运行出错,提示 File "<stdin>" , line 1
- Android WebView页面加载优化
- Arduino IDE的编译执行过程解读
- sscanf用法总结
- NVIDIA Jetson TK1学习与开发(四):一些细节问题
- codeforces #345(div2)
- HDU1710 Binary Tree Traversals
- YTU 1439: 2.4.5 Fractions to Decimals 分数化小数
- Problem F: C语言习题 不等长字符串排序