Re: Set parity of a string

2005-01-26 Thread Peter Hansen
snacktime wrote: Correction on this, ETX is ok, it seems to be just STX with the data I am using. On Wed, 26 Jan 2005 11:50:46 -0800, snacktime <[EMAIL PROTECTED]> wrote: I'm trying to figure out why the following code transforms ascii STX (control-b) into "\x82". The perl module I use returns a

Re: Set parity of a string

2005-01-26 Thread snacktime
Argh, never mind my mistake. I wasn't logging the data correctly the parity conversion works fine. Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Set parity of a string

2005-01-26 Thread snacktime
Correction on this, ETX is ok, it seems to be just STX with the data I am using. Chris On Wed, 26 Jan 2005 11:50:46 -0800, snacktime <[EMAIL PROTECTED]> wrote: > I'm trying to figure out why the following code transforms ascii STX > (control-b) into "\x82". The perl module I use returns a value

Re: Set parity of a string

2005-01-26 Thread snacktime
I'm trying to figure out why the following code transforms ascii STX (control-b) into "\x82". The perl module I use returns a value of "^B", and that is also what the application I am communicating with expects to see. Some ascii characters such as FS and GS come through fine, but STX and ETX get

Re: Set parity of a string

2005-01-23 Thread snacktime
On Sun, 23 Jan 2005 21:00:25 -0500, Peter Hansen <[EMAIL PROTECTED]> wrote: > Peter Hansen wrote: > > snacktime wrote: > >> Is there a module that sets the parity of a string? > > > > As to the specific question: a module is not really required. > > But here's one for you anyway. It raises an exc

Re: Set parity of a string

2005-01-23 Thread John Machin
Peter Hansen wrote: > snacktime wrote: > > Is there a module that sets the parity of a string? I have an > > application that needs to communicate with a host using even parity > > So what I need is before sending the message, convert it from space to > > even parity. And when I get the respons

Re: Set parity of a string

2005-01-23 Thread Peter Hansen
Peter Hansen wrote: snacktime wrote: Is there a module that sets the parity of a string? As to the specific question: a module is not really required. But here's one for you anyway. It raises an exception if any input character is non-ASCII, otherwise when you call set_parity() with a string and

Re: Set parity of a string

2005-01-23 Thread Peter Hansen
snacktime wrote: Is there a module that sets the parity of a string? I have an application that needs to communicate with a host using even parity So what I need is before sending the message, convert it from space to even parity. And when I get the response I need to convert that from even to s

Re: Set parity of a string

2005-01-23 Thread snacktime
On Sun, 23 Jan 2005 23:52:29 +0100, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > "snacktime" wrote: > > > Is there a module that sets the parity of a string? I have an > > application that needs to communicate with a host using even parity > > So what I need is before sending the message, convert i

Re: Set parity of a string

2005-01-23 Thread Fredrik Lundh
"snacktime" wrote: > Is there a module that sets the parity of a string? I have an > application that needs to communicate with a host using even parity > So what I need is before sending the message, convert it from space to > even parity. And when I get the response I need to convert that from