I have a Python code whose output is a .png file. What should I do to get the output in an OpenGL window?
I searched a few places and the closest I got to converting an Image was StringIO() but that didn't seem very helpful.
If you want something to handle the more complex details you could setup your OpenGL using pygame then use
surface = pygame.image.load(fileobj)
Where fileobj is any object with a 'file-like' interface. You would need to modify the PNG generator to write to this object rather than a real file.
How to change a .png output from Python to an OpenGL window output?