On 9/5/06, Rob Richardson <[EMAIL PROTECTED]> wrote:
Greetings!I am using a serial communications package that includes a readline() method to talk to a bar-code scanner. Readline() gives me a string whose last character is a newline ('\n'). I am trying to get rid of the newline. MyString.strip('\n') isn't working. It has no effect. How should I do this?
It seem you pushed the wrong button, but every barcode scanner I worked with (though I'm certain there are much more different types out there) had a way to configure the output. So you can just program the scanner to not send the terminating '\n' (with PS/2 scanners wich "attach" between the keyboard and the PC I used other function to add a prefix for the code - like 0x02 [STX] - so I could easily distinguish codes originated from the scanner and the real keyboard). Anyway, it seems trivial to just ignore that last '\n'... Regards, ~Nuno Lucas ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------

