Wait... WHAT?

Mark Lawrence breamoreboy at yahoo.co.uk
Thu Feb 13 00:36:29 CET 2014


On 12/02/2014 22:14, Tim Chase wrote:
>
> To be pedantic, you can only write *bytes* to files, so you need to
> serialize your lists (or other objects) to strings and then encode
> those to bytes; or skip the string and encode your list/object
> directly to bytes.
>

Really?

 >>> f = open('test.txt', 'w')
 >>> f.write('a string')
8
 >>> f.close()
 >>>

-- 
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.

Mark Lawrence

---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com





More information about the Python-list mailing list