简体   繁体   English

VS Code 是否有用于测试短代码块的命令面板?

[英]Does VS Code Have a Command Panel For Testing Short Chunk of Codes?

I'm new to VS Code.我是 VS Code 的新手。 I wonder if VS Code has any panel to test run chunk of codes instead of creating a new file?我想知道 VS Code 是否有任何面板来测试运行代码块而不是创建新文件? I'm so used to traditional Rstudio, PyCharm, Jupyter Notebook IDE that I could just test out short chunks of code in the output command panel.我已经习惯了传统的 Rstudio、PyCharm、Jupyter Notebook IDE,我只能在输出命令面板中测试一小段代码。 However, it seems VS Code command output is just the terminal, which does not read my python code for the test running small chunks of code.但是,似乎 VS Code 命令输出只是终端,它不会读取我的 python 代码来运行小块代码的测试。 Any suggestion on how to solve this?关于如何解决这个问题的任何建议?

Thanks, Lily谢谢,莉莉

yes it does.是的,它确实。 vs code is such a great lightweight IDE. vs code 是一个非常棒的轻量级 IDE。 https://code.visualstudio.com/docs/editor/debugging https://code.visualstudio.com/docs/editor/debugging

You can make breakpoints or Logpoints and decide which part of the code you want to debug.您可以创建断点或日志点并决定要调试的代码部分。

I think what you are looking for is jupyter notebook extension for vscode.我认为您正在寻找的是 vscode 的 jupyter notebook 扩展。 This is good guide to help you get started这是帮助您入门的好指南

You can create a jupyter notebook in the VSCode:你可以在 VSCode 中创建一个 jupyter notebook:

在此处输入图片说明

Or you can select Run Selection/Line in Interactive Window or Run Selection/Line in Python Terminal :或者您可以选择Run Selection/Line in Interactive Window Run Selection/Line in Python TerminalRun Selection/Line in Python Terminal

在此处输入图片说明

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

相关问题 为什么我的 VS Code 无法将“python”识别为内部或外部命令 - Why does my VS Code not recognize 'python' as an internal or external command 黑色不支持“格式选择”命令 - VS Code 错误 - Black does not support "Format Selection" command - VS Code error Python - 为什么我的短代码不起作用? - Python - why does my short code not work? 为什么在 Atom 或 VS Code (windows) 中,激活 conda 环境在命令提示符下有效,但在终端中无效? - Why does activating conda environment work in command prompt but not in the terminal in Atom or VS Code (windows)? 简单的打印命令在 VS 代码 Python 扩展中不显示任何 output - Simple print command does not show any output in VS Code Python extension Scrapy 没有命令“爬行” - Scrapy does not have command 'crawl' 如何在 VS Code 中使用 Jupyter 变量窗格来加载会话中的变量? - How does one have the Jupyter variable pane in VS Code to load the variables in session? Django的BDD测试工具是否与Rails的测试工具相当? - Does Django have BDD testing tools comparable to Rails' testing tools? Python以什么顺序读取代码? (包括样品代码) - In what order does Python read the codes? (Sample Code included) 比较这两个短代码的计算速度 - Comparing computational speed of these two short codes
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM