May-01-2022, 08:30 PM
Hi all, I am new to Python (and coding as well I guess). I have a menu script which monitors two buttons and calls two different scripts as a sub process depending on the button pressed. The problem is the sub process takes a fair few seconds to load which I think is just all the imports at the start.
I need to speed this up, many of the imported modules in the sub process are loaded by the menu script as well, do I need to import them again in the sub process script?
If so, is there a way of caching / speeding this up?
This is running on an rpi 3 model B using the normal sd card. I have to load the scripts as sub process as I need to time it out after 5 seconds and the sub process script works in a way the traditional timing loops don't work so I have to terminate it instead.
Perhaps I could load some stuff in RAM? Woold that help? No idea how of course :)
I need to speed this up, many of the imported modules in the sub process are loaded by the menu script as well, do I need to import them again in the sub process script?
If so, is there a way of caching / speeding this up?
This is running on an rpi 3 model B using the normal sd card. I have to load the scripts as sub process as I need to time it out after 5 seconds and the sub process script works in a way the traditional timing loops don't work so I have to terminate it instead.
Perhaps I could load some stuff in RAM? Woold that help? No idea how of course :)