pickle saving pygame Surface (python) -


i tried save pygame.surface doesn't let me, error

typeerror: can't pickle surface objects

i can make save surfaces? or maybe there module can save ?

explanation:

a = pygame.surface( (5,5) ) file = open("hello", "w") pickle.dump(a, file) 

i have classes saves in them surfaces.

as monkey said: don't want pickle surface. if need save surfaces' content use pygame.image.save() function.

if prefer surface not actual image file (for whatever reason) use pygame.image.tostring() function lets convert surfaces' content stringbuffer.


Comments

Popular posts from this blog

codeigniter - Fatal error: Call to undefined function lang() in CI Merchant using CardSave -

javascript - CasperJS/PhantomJS failing SSL handshakes on some sites even with --ssl-protocol=any -

python - Received unregistered task using Celery with Django -