How to add type "int" to string ?
Carel Fellinger
cfelling at iae.nl
Sun Jul 15 10:16:21 EDT 2001
Uwe Hoffmann <nospam at nospam.de> wrote:
> shuibo wrote:
>>
>> Hello all :
>> in my program I want to give a char variable a Hex value , for example :
>> a = "Hello World"
>> a = a + 0x00
>> but it display "cannot add type int to string"
>> what can I do ?
>> thanks very very much !
> a = a + chr(0x00)
or even
a = "Hello World\x00"
But I wonder, why would you end a Python string with a null char?
--
groetjes, carel
More information about the Python-list
mailing list