写了一个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,成功。

最新文章

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

热门文章

  1. scanf()函数
  2. Mybatis一二级缓存的理解
  3. 点分治 [IOI2011]Race
  4. su命令,sudo命令,visudo命令
  5. 在xshell中使用Linux语言打开错误提示
  6. sizeToFit的学习与认知
  7. hdu-1181
  8. Flutter实战视频-移动电商-41.详细页_数据接口的调试
  9. 洛谷1303 A*B Problem 解题报告
  10. 利用JavaScript选择GridView行