美文网首页
2021-06-26File “stdin” , line 1

2021-06-26File “stdin” , line 1

作者: 不学无数YD | 来源:发表于2021-06-26 14:04 被阅读0次

File “stdin” , line 1
python hello.py

SyntaxError:invalid syntax

今天在VS code写python,不知道为什么前一次运行还好好的,突然就提示File “stdin” , line 1

原因可能是:

在shell脚本中,运行shell脚本命令;在Python命令行中,运行Python代码。然而,“python hello.py”是一个脚本命令,不是python代码。

解决方法:
在vs code 的终端输入 exit()

相关文章

网友评论

      本文标题:2021-06-26File “stdin” , line 1

      本文链接:https://www.haomeiwen.com/subject/rflzyltx.html