问题
I'm trying to make GUI in pyqt5 with only a button and a simple recursive drawing
what're the ideal tools for this task? I tried Turtle which is simple and get the job done but I don't know how to embed the graphics inside pyqt it opens a different window
回答1:
turtle
is built on top of
tkinter. tkinter
and pyqt5
each use their own event loop. I don't think it is possible (or at least, it
wouldn't be very easy) to mix two different GUI toolkits (tkinter
and pyqt5
)
in one app.
If you want to use turtle
, you should build the GUI with tkinter
and embed a RawTurtle in a canvas.
Or, alternatively, build the GUI with pyqt5
, and make the drawing with, perhaps, a QPen.
来源:https://stackoverflow.com/questions/53518509/embedding-turtle-graphics-in-pyqt5-interface