buttertoad
November 12th, 2008, 05:30 AM
I apologize if this is covered elsewhere but I did not find it.
My goal is a program that will take a chunk of data from a serial connection, remove the garbage, and print one line from it.
So far I can open the serial connection, get the data, remove the esc characters but I can't figure out how to strip the line I want. The line always starts with #! and ends with #n. The line is formated how I want it as far as whitespace goes, but the length of the line is subject to change.
I'm sure the answer is staring me in the face but I can't figure it out.
I'm very new to python so any help would be greatly appreciated.
Thanks.
My goal is a program that will take a chunk of data from a serial connection, remove the garbage, and print one line from it.
So far I can open the serial connection, get the data, remove the esc characters but I can't figure out how to strip the line I want. The line always starts with #! and ends with #n. The line is formated how I want it as far as whitespace goes, but the length of the line is subject to change.
I'm sure the answer is staring me in the face but I can't figure it out.
I'm very new to python so any help would be greatly appreciated.
Thanks.