Replies: 2 comments
-
These are all interesting ideas. Thank you for developing them and sharing. I do consider importing files in imported mode to be an important issue but don't have time to investigate it now. At the moment, the gallery show is taking up a lot of time, and outside of that, I'm dealing with some platform issues affecting Processing mode. I'd like to finish that off and write the associated documentation. That documentation will also provide more insight into how py5 actually works, which will help people develop more advanced projects. Once these things get off my plate, importing files will be my main concern and I'll focus on that. I'll be referring back to all of these discussion threads and also doing some experimenting to get ideas of what is possible. I'll get there soon enough! |
Beta Was this translation helpful? Give feedback.
-
I think this discussion is being taken care of here now: #299 |
Beta Was this translation helpful? Give feedback.
-
I think we had some of this discussion earlier, and I know this is not a priority, but I think here is a good place to discuss crazy ideas and have them aired for when they become less crazy and doable.
I've been thinking a lot about about how to allow learners to structure sketches in multiple files. If they are using module mode, it is a breeze. If they are in imported mode (which I myself use a lot for convenience) things can get a bit tricky with the special system variables like
width
andmouse_x
. I wish I could move them [the learners] to [use] module mode in two steps, first in the "secondary files".@hx2A has suggested some complex solutions at some point that involved treating the other files/modules as imported also, doing the imported mode transformations on them and I don't think I like that, I'm trying to think aloud and articulate why.
I wondered if we could have some compromise, middle of the way solution that didn't require transforming the code of the imported modules. Also, this could let people use module mode modules both in imported mode and module mode sketches.
Here an example of what we have:
other.py
main.py
module moderesult:
400
main.py
imported modeThe unwanted result:
<bound method Sketch._get_width of <py5.sketch.Sketch object at 0x7f430df71d50>
So... [possibly my conclusion is that] I think I wish the imported module would behave just as if it was imported from a module mode sketch. [It might make it easier to start teaching module mode, maybe starting from "secondary" smaller modules].
UPDATE: For my own helper libraries I can almost do it, as I mostly avoid the system variables, and I could do something like this if needed (but I wouldn't like to explain that in class):
Beta Was this translation helpful? Give feedback.
All reactions