Hi Edward -
 
A Python string object or unicode object should convert to char[] automatically. Right
now, the Byte converter expects to convert an int rather than a string, so a workaround
might be to convert your list of strings to a list of ints to pass to the constructor:
 
stuff = ['s', 't', 'u', 'f', 'f']
 
asint = map(ord, stuff) # pass asint to the constructor
 
Hope this helps - I'll add a tracker issue that the converter should probably be smart
enough to convert a string to a byte array by itself...

Brian Lloyd        [EMAIL PROTECTED]
V.P. Engineering   540.361.1716             
Zope Corporation   http://www.zope.com

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Edward Diener
Sent: Monday, February 07, 2005 1:54 PM
To: [email protected]
Subject: [Python.NET] .NET character and byte

What is the Python equivalent to the .NET ‘char’ and ‘byte’ types ? I need to pass in an array of bytes to a .NET constructor and when I attempted to pass in a list of strings of single characters, it failed. Is there a way of doing this in PythonDotNet ?

_________________________________________________
Python.NET mailing list - [email protected]
http://mail.python.org/mailman/listinfo/pythondotnet

Reply via email to