vscode python没有输出

2024-09-07 19:05:13 发布

您现在位置:Python中文网/ 问答频道 /正文

print("hello")

无论我在python文件中写什么,它只给出当前文件路径。我怎样才能修好它

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
Gangs-MacBook-Pro:yashirq gangzhao$ /usr/bin/python3 /Users/gangzhao/yashirq/Practice/Python/Grokking_Algorithms/Binary_Search.py

enter image description here


Tags: 文件the路径defaulthellobinisshell
3条回答

你是如何运行这个文件的?通常必须设置一个environment。如果只想运行单个python文件并在集成终端中查看输出,请尝试右键单击编辑器,然后单击Run Python File in Terminal

我只是用VS代码运行了这个程序,它运行得很好

只需右键单击并选择“在终端中运行Python文件”选项。它应该有用

Run Python file in terminal

Sample Code

检查terminal.integrated.inheritEnv设置。我在ubuntu上,并将其设置为false/unchecked。切换到true/checked可恢复终端功能

相关问题 更多 >