I am searching a way to create a window in python where I can control each individual pixel. And also where I can update them live using functions. My objective here is to create a python package. So the idea would be :
import package
app = package.main()
app.init() # This would create the window
app.set_pixel(0, 0, (255, 0, 0)) # And this would set the pixel with x = 0 and y = 0 to red
I have tried with PyGame and Tkinter but they both use a main loop and all functions called after the loop started are not executed unless the app is closed.
Is there a way to do something like this where everything can be updated live ?