Struct wrapping Python object
Please excuse me if this is a really noobie question, I'm just picking up the language...
I'm trying to port an old GUI application I wrote in Python using Pyglet. My plan is currently, assuming there are no Mojo GUI library, reimplement all of the data processing in Mojo with an interface to Python to draw the UI.
The first pattern I imagined would be something like:
where I have a Python module which defines a window:
The glaringly obvious question is, should I do this? Second is, how should I type the struct? And lastly, if this is possible, what are the implications of referencing a
PythonObject
in my Mojo struct?3 Replies
This seems to work, although I would prefer to use
fn
over def
so I can understand / use static typing here
does it make difference in performance or something?
pure python vs mojo-python-imports
Congrats @Ghosteez, you just advanced to level 1!