"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
"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
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
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
"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
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