PDA

View Full Version : For Loop in Callbacks?


DrunkenBrit
02-18-2009, 03:49 AM
Hi,

I'm assuming you can't have for loops (or any loops?) inside timer callback functions? I'm getting an invalid syntax error when attempting this. If this is the case, I take it it's due to the for loop possibly taking longer to execute than the time before the callback should be invoked again?

Thanks,

-DB

farshizzo
02-18-2009, 09:57 AM
There is no limitation on what you can do in a callback. The problem is probably that you have invalid syntax in your code. Can you post the code and the Python traceback of the error?

DrunkenBrit
02-19-2009, 12:26 AM
I solved it pretty much after I posted thanks, it was just a newbie syntax error but it confused me as the exact same for loop worked outside of the callback.