我是python的初学者,在学习脚本编程的时候,报了如下错误

$ python hello.py运行失败

 


 科普知识时刻

 交互式编程:直接在命令行写代码

$ python hello.py运行失败

脚本式编程:把代码写在一个.py后缀名的文件里面

然后在命令行调用文件名 $ python hello.py


错误原因

$ python hello.py

$是unix或者linux里面的专用符号,$的意思就是“提示用户输入命令行”


 正确的做法

先通过dos命令进入hello.py的文件位置,然后输入python hello.py

$ python hello.py运行失败

相关文章:

  • 2021-10-03
  • 2021-08-07
  • 2021-10-04
  • 2021-09-21
  • 2022-03-07
  • 2022-01-03
  • 2021-10-11
  • 2021-11-15
猜你喜欢
  • 2022-02-04
  • 2021-08-31
  • 2021-08-14
  • 2022-12-23
  • 2021-10-03
  • 2021-11-20
  • 2021-08-04
相关资源
相似解决方案