belangeo / pyo

Python DSP module
GNU Lesser General Public License v3.0
1.32k stars 132 forks source link

"AttributeError: 'App' object has no attribute 'mainloop'" when printing from GUI command prompt #88

Closed DrPyser closed 7 years ago

DrPyser commented 7 years ago

Printing a value from the GUI's interpreter prompt results in a

AttributeError: 'App' object has no attribute 'mainloop'

error message instead.

With Python 2, on Fedora 24, using jack.

belangeo commented 7 years ago

I can't reproduce here (debian stretch, also with jack). Which GUI toolkit are you using, wxpython or tkinter (pyo first try to import wx, if it fails it falls back to tkinter)? Can you paste a script that gives you the error? Thanks!

DrPyser commented 7 years ago

Wxpython.

As far as I know, a minimal example would be:

from pyo import *
s = Server().boot()

s.gui(locals())

Then, in the GUI's interpreter input prompt, evaluating "print 1" or printing any other value would result in the error message above.

belangeo commented 7 years ago

Can you try with the python3 syntax for the print statement, ie "print(1)". We must use this syntax now because there is a from future import print_function in the pyo source files.

DrPyser commented 7 years ago

That works. Thanks.

belangeo commented 7 years ago

Cool! On the other hand, I do not understand why you didn't get this error:

SyntaxError: Missing parentheses in call to 'print'