来自外部文件的输入在调试时与Microsoft Python与代码扩展
在调试时,我正在尝试按照VS代码文档中的建议读取输入,此处(通过添加“ args”:[<“,input.txt”)到启动.json)。它不起作用,因为Microsoft的Python扩展程序将自动逃脱(py -lt;“”)(用“ \ \”)自动逃脱(请参见下面的控制台输出)。
cd /workspaces/pyt ; /usr/bin/env /usr/local/bin/python /home/vscode/.vscode-server/extensions/ms-python.python-2022.7.11332232/pythonFiles/lib/python/debugpy/launcher 41587 -- /workspaces/pyt/test.py \< input.txt
从外部文件读取输入的方式确实与其他VS代码扩展相关,例如使用C/C ++。有什么方法可以使其与Python扩展程序(在调试时)使用?
While debugging, I am trying to read input from external file as advised in the VS Code docs here (by adding "args" : ["<", "input.txt"] to launch.json). It doesn't work as the redirect ("<") is automatically escaped (prepended with "\") by the Microsoft's Python extension (see the console output below).
cd /workspaces/pyt ; /usr/bin/env /usr/local/bin/python /home/vscode/.vscode-server/extensions/ms-python.python-2022.7.11332232/pythonFiles/lib/python/debugpy/launcher 41587 -- /workspaces/pyt/test.py \< input.txt
This way of reading input from external file does work with other VS Code extensions, for example with C/C++. Is there any way to make it work with the Python extension (while debugging)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此已在VSCODE 1.67.2中求解,
请尽快更新。
This has been solved in Vscode 1.67.2
Please update as soon as possible.