[IronPython] Convert a PythonBuffer to a byte[]

Jeff Hardy jdhardy at gmail.com
Tue Apr 27 03:40:58 CEST 2010


I can't seem to find any easy to convert a PythonBuffer (created in
Python and passed to C#) to a byte[]. The best solution I've found so
far is to call __getslice__ to get a string and convert that to a
byte[]. Is there a better way to so this? If not, will __getslice__
always return a string, or will it depend on how the buffer was
created?

- Jeff



More information about the Ironpython-users mailing list