帮助,我似乎不能打印任何东西,只要我调用pyo音频服务器。
它只是退出而不返回任何内容。
甚至像这样的东西:
from pyo import *
s = Server()
print("this is not printed")
s.boot()
x = 3.4
print(x,"neither are these")这应该是可行的,对吧?还是我大错特错了?
我使用的是python模块pyo版本1.0.1和Python版本3.7.3,运行时使用的是Python idle3.7
顺便说一句:音频输出工作,我只是想打印调试的目的
发布于 2021-07-07 22:15:05
问题似乎是重定向stdout,如下所示:stdout redirect from Jupyter notebook is landing in the terminal
下面的例子对我很有效。我不知道这个修复是否搞砸了pyo -我想图形用户界面部分可能会有一些问题-但在应用这个修复之后,我已经能够产生我想要的声音。
# %%
import sys
old_stdout = sys.stdout
# %%
print('Hello World') # Outputs 'Hello World'
# %%
s=Server()
print('Hello Server') # No output; 'Hello Server' appears in the terminal that called python to begin with
# %%
sys.stdout = old_stdout
print('Hello Again') # Outputs 'Hello Again'https://stackoverflow.com/questions/61317411
复制相似问题