Visual Studio Code 没有显示 Python 的输出 [英] Visual Studio Code is not showing the ouput of Python

查看:111
本文介绍了Visual Studio Code 没有显示 Python 的输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 Python 真的很陌生,刚刚开始学习 Sendtex 的Python 3 基础知识"课程(链接:

如果我选择 Python,它会进入调试模式.所以,没有任何输出.

解决方案

我想你可以从

如果你想添加Python路径,你可以去菜单文件首选项设置,然后添加Python路径,如下面:

code-runner.executorMap":{python":\"C:\\Program Files\\Python35\\python.exe\"}

I am really new to Python and just started the course "Python 3 basics by Sendtex (Link: https://www.youtube.com/channel/UCfzlCWGWYyIQ0aLC5w48gBQ)".

  • I am trying to use Python with Visual Studio Code.
  • The downloaded version of Python is 3.6.4.
  • I have installed the Python extension in Visual Studio Code and have followed the procedure.

However, I am not able to get any output. Below is the attached screenshot.

If I select Python it enters debugging mode. So, there isn't any output.

解决方案

I think you can get your answer from How to execute Python code from within Visual Studio Code.

There is a much easier way to run Python, and configuration is not needed:

  1. Install the Code Runner Extension
  2. Open the Python code file in Text Editor, and then use shortcut Ctrl + Alt + N, or press F1 and then select/type Run Code. The code will run and the output will be shown in the Output Window.

If you want to add the Python path, you could go to menu FilePreferenceSettings, and add the Python path like below:

"code-runner.executorMap":
{
  "python": "\"C:\\Program Files\\Python35\\python.exe\""
}

这篇关于Visual Studio Code 没有显示 Python 的输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆