Re: hex sending

2006-10-05 Thread Paul Rubin
"hiroc" <[EMAIL PROTECTED]> writes: > s.send("abc") # send test string > I need to send hex:"10 06 00 0f 02 bc d1" instead of "abc" See the binascii module: import binascii # a2b_hex stands for "ascii to binary conversion, hex format" # you must remove the spaces binary = binascii.a2

Re: hex sending

2006-10-05 Thread Tim Roberts
"hiroc" <[EMAIL PROTECTED]> wrote: >s.send("abc") # send test string > >I need to send hex:"10 06 00 0f 02 bc d1" instead of "abc" > >hoW? One ugly way is s.send( "\x10\x06\x00\x0f\x02\xbc\xd1" ) -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/ma

Re: hex sending

2006-10-04 Thread Stoune
hiroc wrote: > I want send pairs of hexadecimal characters, abc is only my test hex > char is real > Possibly this code helps to you: import binascii binascii.hexlify('hello worlds') Output: '68656c6c6f20776f726c6473' -- http://mail.python.org/mailman/listinfo/python-list

Re: hex sending

2006-10-04 Thread hiroc
I want send pairs of hexadecimal characters, abc is only my test hex char is real Fredrik Lundh wrote: > "hiroc" wrote: > > > s.send("abc") # send test string > > > > I need to send hex:"10 06 00 0f 02 bc d1" instead of "abc" > > do you want to send seven binary bytes, or pairs of hexadecimal

Re: hex sending

2006-10-04 Thread Fredrik Lundh
"hiroc" wrote: > s.send("abc") # send test string > > I need to send hex:"10 06 00 0f 02 bc d1" instead of "abc" do you want to send seven binary bytes, or pairs of hexadecimal characters separated by whitespace ? how do you map from "abc" to "10 06 00 0f 02 bc d1", by the way? what encoding is

hex sending

2006-10-04 Thread hiroc
s.send("abc") # send test string I need to send hex:"10 06 00 0f 02 bc d1" instead of "abc" hoW? -- http://mail.python.org/mailman/listinfo/python-list