Bill Allen wrote:
I have found that there are a couple of ways to convert a byte array to a
string in Python. Is there any advantage or disadvantage to either method?
my_bytes = b'this is a test'
str(my_bytes,'utf-8') yields 'this is a test'
my_bytes.decode('utf-8';) yeilds 'this is a tes
I have found that there are a couple of ways to convert a byte array to a
string in Python. Is there any advantage or disadvantage to either method?
my_bytes = b'this is a test'
str(my_bytes,'utf-8') yields 'this is a test'
my_bytes.decode('utf-8';) yeilds 'this is a test'
--Bill
gert wohlgemuth wrote:
> As anybody an idea how I can do this in python?
I can think of three ways:
Strings in Python can contain arbitrary binary values, so they can be used.
If they're going to be modified often, you may use a list,
or you may use the array module for performance.
Are you s
gert wohlgemuth wrote:
> Hi,
>
> I'm used to java byte arrays (byte[]) and need the same type in python,
> cause we have a couple of established web services, which return a byte[] or
> take a byte[] as parameter.
>
> As anybody an idea how I can do this in python?
A string can be used as a byte
Hi,
I'm used to java byte arrays (byte[]) and need the same type in python,
cause we have a couple of established web services, which return a byte[] or
take a byte[] as parameter.
As anybody an idea how I can do this in python?
Thx,
g.
___
Tutor mai