[英]Why can't my code run in Visual Studio Code?
在图像中,您使用了code hello.py
。 您应该改用python hello.py
。 只有在安装 Python 软件时选中了“将 Python 添加到路径”,您才能在命令提示符下运行。
如果您使用的是 Mac
在 Mac 中,会自动安装 Python 2.7。 如果你想使用 Python 3,那么你必须从 Python 官方网站手动安装并使用python3 hello.py
来使用 Python 3。
永远记住,将使用以下命令运行 Python 文件: python yourfile_name.py
。
在您的图像中,您尝试使用以下命令运行 Python 文件: code hello.py
不要使用code hello.py
,而是尝试使用python hello.py
更改它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.