python - How do I unload images in Pygame? -


i trying rename image being viewed in pygame window (same program), , since isn't idea, had rename @ end of program. however, still gives me error:

windowserror: [error 32] process cannot access file because being used process 

i tried "quitting" (un-initializing) pygame , display, still says cannot rename file error above.

is there way unload images? need do?

thanks!

try getting file object , using instead, example:

f = open('myfile.png') pygame.image.load(f) f.close() 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

javascript - Bootstrap Popover: iOS Safari strange behaviour -

spring cloud - How to configure SpringCloud Eureka instance to point to https on non standard port -