VS Code Python 在调用输入后不会返回 [英] VS Code Python Wont Return After Call to Input

查看:33
本文介绍了VS Code Python 在调用输入后不会返回的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 VSCode 环境 (macos v1.48.0) 有一个非常奇怪的行为,特别是 Python 扩展.这只是最近发生的,以前不是问题,调试此类代码工作正常.我的问题是我正在尝试调试一个脚本,该脚本最初发出用户输入请求 data = input("text") 并且在将文本输入终端后,执行永远不会恢复.我已确保我的启动设置脚本有效且符合预期.我实际上已经完全卸载并重新安装了 VSCode.此外,脚本在 VSCode 之外按预期运行.显然,动机是调试远远超出用户输入的代码,当然我可以硬编码用户输入值来绕过这些函数调用,脚本的其余部分运行良好,但我只是不知道为什么在此之后没有恢复执行调用输入... ??

I have a real odd behavior with my VSCode environment (macos v1.48.0) specifically with the Python extension. This only occurred recently, previously not a problem and debugging such code worked fine. My problem is I'm trying to debug a script that initially makes a user input request data = input("text") and after entering text into the terminal, the execution never resumes. I've ensured my launch settings script is valid and expected. I've actually gone through completely uninstalling and reinstalling VSCode. Additionally, the script runs as expected outside of VSCode. Obviously the motivation is to debug the code far beyond user input, and of course I can hardcode user input values to bypass these function calls, rest of the script runs fine, but I'm simply at a loss for why execution isnt resuming after this call to input... ??

非常感谢.

推荐答案

根据你的描述,可以参考以下方法:

According to your description, you could refer to the following ways:

  1. 请尝试为其设置断点以检查是否可以调试成功.

  1. Please try to set a breakpoint for it to check whether it can be debugged successfully.

由于python脚本的调试功能由python扩展,您可以尝试禁用其他扩展并重新安装python扩展.

Since the debugging function of the python script is provided by the python extension, you could try to disabled other extensions and reinstall the python extension.

如果您使用的python扩展是最新版本,建议您降级使用其他版本的python扩展.例如:(python版本:v2020.7.96456)

If the python extension you are using is the latest version, it is recommended that you downgrade it and use other versions of python extensions. For example:(python version: v2020.7.96456)

这篇关于VS Code Python 在调用输入后不会返回的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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