Re: marshal and unmarshal

2006-08-27 Thread Fredrik Lundh
leo wrote: > 'c\x00\x00\x00\x00\x01\x00... > > ", line 2> > > Question: > 1. why unmarshal data is > ", line 2> because that's what compile returns, of course. marshal.dumps takes a Python object and turns it into a string; marshal.loa

marshal and unmarshal

2006-08-26 Thread leo
Hi, following is marshal and unmarshal script import marshal strng = """ print 'hello world' """ code = compile(strng, "", "exec") data = marshal.dumps(code) strng0 = marshal.loads(data) print repr(data) print "-"*100 print