简体   繁体   English

Visual Studio Python外壳

[英]Visual Studio Python Shell

Quick question. 快速提问。 I'm scratching my head as to why the latest version of visual studio offers tabs with interactive python terminals. 我为最新版本的Visual Studio提供带有交互式python终端的选项卡而scratch之以鼻。 As well as debugging terminals all built into the tabs that can be snapped. 除调试终端外,所有这些终端都内置在可以捕捉的选项卡中。 But when I attach & test run something it just opens a normal python terminal in CMD rendering the built terminals in VS useless. 但是,当我附加并运行测试时,它只是在CMD中打开一个普通的python终端,从而使VS中的内置终端无效。 I'm just thinking why lol. 我只是在想为什么大声笑。 They never get used. 他们从不习惯。 Is there a way to test run script in the built-in interactive terminals instead of it opening a Python shell? 有没有一种方法可以在内置的交互式终端中测试运行脚本,而不是打开Python Shell?

You can learn more about this feature here , it's just another repl with the convenience of being within Visual Studio. 您可以在此处了解有关此功能的更多信息,这只是使用Visual Studio的便利而已。 There's also some interesting connections to the editor that you can send selected code lines to the interactive window. 与编辑器之间还有一些有趣的联系,您可以将选定的代码行发送到交互式窗口。 I'm not sure how variable scoping works between the two but sometimes you just want to experiment in the repl before integrating it into a working python file. 我不确定两者之间的变量作用域如何工作,但有时您只想在repl中进行实验,然后再将其集成到有效的python文件中。

I mostly put the Immediate Window to use for some interactive exploratory coding when I develop in Visual Studio. 在Visual Studio中进行开发时,我主要将“ Immediate Window用于一些交互式的探索性编码。 This is scoped to where the current breakpoint is set which is good for manipulating things on the fly and getting feedback about my variables and what not. 这是在设置当前断点的范围内进行的,这非常适合即时操作并获取有关我的变量和不变量的反馈。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio 2017 中的 Python 3.6 如何在交互式 Shell 中运行程序 - Python 3.6 in Visual Studio 2017 How to Run Program in the Interactive Shell 打开Django Shell时出错-Visual Studio中的Python交互式窗口 - Error While Opening Django Shell - Python Interactive Window in Visual Studio 有没有办法在 visual studio 代码中使用 python IDLE Shell? - Is there any way to use the python IDLE Shell in visual studio code? Difficulty running a Python code in Visual Studio Code, runs in the Python shell 但不是这里 - Difficulty running a Python code in Visual Studio Code, runs in the Python shell but not here 我的代码在python shell中运行良好,但在我的Visual Studio代码上运行它时没有显示任何内容 - My code works fine inside the python shell, but not showing anything when running it on my Visual studio code Python/Visual Studio 错误:终端进程无法启动:shell 可执行文件的路径不存在 - Python/Visual Studio error : The terminal process failed to launch: Path to shell executable does not exist UltiSnips shell/python 插值和 ${VISUAL} - UltiSnips shell/python interpolation and ${VISUAL} Visual Studio完成python - Visual studio completion python 视觉工作室中的python - python in visual studio Visual Studio Code - 外部 Shell 中的 Output(未集成) - Visual Studio Code - Output in the External Shell (Not Integrated)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM