How to save an image as a variable?
问题 Now, I have a python game that has sprites, and it obtains the images from files in its directory. I want to make it such that I do not even need the files. Somehow, to pre-store the image in a variable so that i can call it from within the program, without the help of the additional .gif files The actual way i am using the image is image = PIL.Image.open('image.gif') So it would be helpful if you could be precise about how to replace this code 回答1: Continuing @eatmeimadanish's thoughts, you