File "<stdin>" , line 1
2024-08-30 09:25:32
写了一个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,成功。
最新文章
- 免费领取百度云盘2048G永久空间,永久离线下载特权
- H5页面在QQ和微信上分享,为什么不能自定义设置图片和摘要?
- ThinkPHP随笔
- 从头学Qt Quick(2)-- QML语法从一个简单的例子说起
- dexDebug ExecException finished with non-zero exit value 2
- DedeCMS 5.7 config.php 跨站脚本漏洞
- Fancybox——学习(1)
- PHP Curl模拟登录并抓取数据
- python装饰器实现对异常代码出现进行监控
- 奥酷HTML5视频直播系统AMS6.0
- Deep Learning回顾#之LeNet、AlexNet、GoogLeNet、VGG、ResNet - 我爱机器学习
- python-模块的导入import
- Unicode和UTF-8之间的关系
- Java之集合(七)Map
- Linux文件句柄数调整
- Task 3 求最大数组和
- MySQL的各种SHOW
- HighCharts画时间趋势图,标示区以及点击事件操作
- break与continue语句
- 2018软工实践—Alpha冲刺(2)