How about this: (and I understand that my suggestion may just be theoretical):
You call the self.osc.main()
loop from the self.main()
loop. To do that, you will have to edit your self.osc.main()
function so that it does not run forever but only once. You keep the self.main()
loop the same and call the self.osc.main()
once every loop.
INSTEAD OF WHAT YOU ARE DOING NOW WHICH IS SOMETHING LIKE THIS:
def main(): #This is the self.osc.main() function
while True: #run forever
doSomething()
def main(): #This is the self.main() function
while True: #also run forever
doSomethingElse()
YOU CAN DO THIS INSTEAD:
def main(): #This is the self.osc.main() function
doSomething() #notice I removed the loop. It only runs once. This is because the looping is handled by the other main() function (the one you call self.main())
def main(): #This is the self.main() function
while True: #also run forever
self.osc.main() #since we have now changed the self.osc.main() loop to run only once
doSomethingElse()
I Hope That Helps.