简体   繁体   English

在 vscode jupyter notebook 输出中显示问题/输入

[英]Show question/input in vscode jupyter notebook output

Is there any way to show input question in cell output while using vscode jupyter notebook?有没有办法在使用 vscode jupyter notebook 时在单元格输出中显示输入问题? When I use Google Colab, there are question in the cell output.当我使用 Google Colab 时,单元格输出中有问题。 I want to know how to show question without using print().我想知道如何在不使用 print() 的情况下显示问题。

In google Colab: https://i.stack.imgur.com/L71OS.png在谷歌 Colab 中: https ://i.stack.imgur.com/L71OS.png

In vsCode: https://i.stack.imgur.com/4szQJ.png在 vsCode: https ://i.stack.imgur.com/4szQJ.png

At present, the Jupyter function in VSCode is provided by Python extension.目前,VSCode 中的 Jupyter 功能是由 Python 扩展提供的。 The bottom of each cell is used to display output.每个单元格的底部用于显示输出。 Therefore, the input it receives is provided by the input box above, which is its display input mode.因此,它接收到的输入是由上面的输入框提供的,也就是它的显示输入方式。

在此处输入图片说明

If you want to display input and output in the same place, it is recommended that you use a python file, and the terminal will display the input and output content in turn.如果要在同一个地方显示输入和输出,建议使用python文件,终端会依次显示输入和输出内容。

在此处输入图片说明

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM