N O T E In the above, urxvt is the name of my choice for terminal, -e is the flag required to pass a command that is to be executed upon startup, and python ${file} is the command to execute.
My recommendation is to get the command necessary to fire up a new terminal, and directly execute a python script, working elsewhere before editing your task-file.
我也有类似的问题,我想你运行程序时
ctrl+shift+B表示构建。
不用构建,您只需通过
ctrl+shift+`
打开终端后,键入要运行的文件名。
在要运行的文本文件中单击鼠标右键,然后选择“在终端中运行Python文件”。
简介
如果希望像普通用户那样与程序交互,则需要从命令行(终端)运行脚本,而不是直接在Visual Studio代码中运行脚本。
精化
Visual Studio代码中显示的输出不用于与底层脚本交互,也不具有直接从键盘读取任何输入的能力(它只显示您决定运行的任何脚本的输出)。
解决办法
您可以做的是编辑任务文件,以自动生成您选择的终端,而不是直接运行
python
解释器。根据您所使用的操作系统和可用的终端,执行此操作所需的编辑可能看起来有些不同,但它们都应遵循相同的模式。
相关问题 更多 >
编程相关推荐