Can't work this XDR out

Fred L. Drake fdrake at cnri.reston.va.us
Tue Apr 20 09:18:38 EDT 1999


Matthew Robert Gallagher writes:
 > Whilst trying to pack a list xdr packer asks for
 > 
 > (list, pack_item)
 > 
 > what is the pack_item can't work this out as there are no examples

Matthew,
  pack_item will typically be another method from the same packer
object.  For example, to pack a list of ints, use this:

	import xdrlib
	p = xdrlib.Packer()
	p.pack_list([1, 2, 3], p.pack_int)

  I hope this helps.  I'll add an example to the documentation.


  -Fred

--
Fred L. Drake, Jr.	     <fdrake at acm.org>
Corporation for National Research Initiatives




More information about the Python-list mailing list