Thank you for answer, but at the same time I have to confess myself I am mostly embedded so I am closer to assembler and ANSI C but not to the OOP
This is my first apk in OOP (Python) and target is RaspberryPi4, I write and test code on PC Python, then just transfering file to RPi.
I think I feel what you write about threading - probably different priority of different piece of code. Like interrupts in embedded.
My code now looks like this:
class MyCode(wx.Panel):
....
....
....
def on_timer(self):
mycode executed repeatedly is here
wx.CallLater(500, self.on_timer)
Now looking at my code I am horrified: Would this calling its own function make stack pointer to overflow in time? I think it is also called “RAM leaking” ? (this on_timer() is inside the only one class I have)
I had before something like this (I had to find it again, it looks really to be this):
I read and tried understand what exactly CallLater does. It is written this:
CallLater maintains references to its instances while they are running. When they finish, the internal reference is deleted and the GC is free to collect naturally.
I do not completely understand this because no idea what is GC?
But it lloks like that CallLater only sets up somewhere in wxTimer some flag to call function later? So if this is the case there is no threat of RAM leaking?
Hello. Sorry for my bad English. I’m new in Raspberry and python programming and trying to use wx graphical widgets in my python script and use this script to run on startup on RPi 4. the problem is that i should to activate virtenv whenever i wanna run my script and without it, i get the error that the module couldn’t be found. Do u have any suggestion?
Thanks
thx very much for the solution but i’m getting the same error as i tried to run terminal script in my python code. source: not found
but the command works prefectly when i write it directly in the terminal