I'm trying to write a simple application and I'm running into a couple of problems that I thought someone might be able to shine light one.
First is that I can't seem to access global variables through the event handlers. For example:
Code: Select all
cartridgecount = 0
def ontrigger(self, state):
cartridgecount += 1
Will not work. Is there a way to do this or achieve similar functionality where a handler is able to modify something that the main process is accessing?
The second problem is somewhat related, but I can't figure out how to add a class method as an event handler, which could potentially solve this issue, although I'm assuming some mutex locks would be needed still.