Alex Rivera | Logout

Python: saving objects and using pickle. extension of filename

Asked 2010-12-25T11:14:36.240
24

Hello I´m trying using the next piece of code:

import pickle 
object = Object() 
filehandler = open(filename, 'w') 
pickle.dump(object, filehandler) 

I would like to know what should be the extension of the file 'filename'. Thank you!

Edit
Report

1 Answer

9

Depends on what you want to do with the file.

filename should be sufficient.

And don't use object as an identifier. It shadows the builtin object.

answered 2010-12-25T11:26:32.340

Your Answer