[Vobject] I can't write cal to a file

Didier BRETIN didier at bretin.net
Fri Jul 13 00:35:36 CDT 2007


On 13/07/2007 07:25, Didier BRETIN wrote:
> Hi,
> 
> I generate a calendar from data read from an unicode xml file.
> I can create all my events (thanks Jeffrey :)), and then I would
> like to write in a file the serialized calendar.

I just found the solution by using module codecs !
	import codecs
	def write(self):
		f = codecs.open(self.file, encoding='utf-8', mode='wb')
		stream = self.cal.serialize()
		f.write(stream)
		f.close()

And it works :).
-- 
Didier BRETIN
http://www.bretin.net/



More information about the VObject mailing list