在VSCODE中运行简单的Python / Abjad代码

发布于 2025-02-12 15:33:16 字数 861 浏览 1 评论 0原文

Windows 10,Python 3.10.5

此简单代码

import abjad
n = abjad.Note("c'4")
abjad.show(n)

使用py test.py从命令行运行时, 可完美地工作。它会自动启动我的PDF查看器,显示以下内容:

但是,当我尝试从Visual Studio代码运行它时,它没有“工作”:它不会启动PDF查看器。

这是终端中的Visual Studio代码打印的内容:

PS G:\My Drive\repos\ttd> & "g:/My Drive/repos/ttd/ttdvenv/Scripts/Activate.ps1"

(ttdvenv) PS G:\My Drive\repos\ttd>  & 'g:\My Drive\repos\ttd\ttdvenv\Scripts\python.exe' 'c:\Users\Gianmaria\.vscode\extensions\ms-python.python-2022.8.1\pythonFiles\lib\python\debugpy\launcher' '62264' '--' 'g:\My Drive\repos\ttd\test.py'

(ttdvenv) PS G:\My Drive\repos\ttd> 

任何建议是问题吗? 谢谢你!

Windows 10, Python 3.10.5

This simple code

import abjad
n = abjad.Note("c'4")
abjad.show(n)

works flawlessly when I run it from the command line using py test.py. It automatically launches my pdf viewer showing this:
python output

But when I try to run it from Visual studio code it doesn't "work": it doesn't launch the pdf viewer.

This is what Visual studio code prints in the terminal:

PS G:\My Drive\repos\ttd> & "g:/My Drive/repos/ttd/ttdvenv/Scripts/Activate.ps1"

(ttdvenv) PS G:\My Drive\repos\ttd>  & 'g:\My Drive\repos\ttd\ttdvenv\Scripts\python.exe' 'c:\Users\Gianmaria\.vscode\extensions\ms-python.python-2022.8.1\pythonFiles\lib\python\debugpy\launcher' '62264' '--' 'g:\My Drive\repos\ttd\test.py'

(ttdvenv) PS G:\My Drive\repos\ttd> 

Any suggestion what can be the issue?
Thank you!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文