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
Post a Comment