【发布时间】:2020-11-08 03:04:09
【问题描述】:
我正在尝试调试一个简单的 python 文件。 test.py 文件只包含文本 print("hello")。 当我选择 Run->Start Debugging 时,我会看到一个带有以下文本的模式对话框:
h.toLowerCase 不是函数
当我打开配置时,我看到:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Module",
"type": "python",
"request": "launch",
"module": "simple"
}
]
}
这是导航到帮助->关于->复制的结果。
版本:1.51.0(用户设置)提交: fcac248b077b55bae4ba5bab613fd6e9156c2f0c 日期: 2020-11-05T18:18:23.642Z 电子:9.3.3 铬:83.0.4103.122 Node.js:12.14.1 V8:8.3.110.13-electron.0 操作系统:Windows_NT x64 10.0.19042
如果我启动一个命令窗口,我可以输入 python 或 pip,所以这些东西在我的路径中。
Python --version generates
3.9.0
VS Code 扩展显示我安装了以下扩展。
Python v2020.10.332292344 用于 VSCode 0.2.3 的 Python
如果我右键单击 python 文件并单击在控制台中运行 python。它工作正常。我在控制台中看到文本“Hello”。
【问题讨论】:
-
你执行过命令吗:
Python: Select Interpreter -
你能分解一下我是怎么做的吗?在VSC的左下角,它说Python 3.9.0 64 bit error 0 warning 0 Python Current File (t2)
-
右下角选择语言模式是说python。
-
为什么python解释器会调用javascript函数
-
我已经尝试卸载并重新安装 VSCode 和 Python 对这个盒子没有影响。