2nd Try: Trouble writing lines to file that include line feeds - Newbie
daniel.t.healy at gmail.com
Mon Dec 23 01:55:28 CET 2013
Overview: I'm attempting to read strings from a serial port. Each string ends with a carriage return and line feed. I want to write those strings to a file, like a log file. So, if I send P1 and the P2 on a new line, I would expect to open this file and find (line 1) P1 (line 2) P2.
Problem: The file only contains P2. It always overwrites the first line. I can send 20 strings and the file will always contain the last string received.
#Import the serial module
#Open the serial port w/ settings
#Print data received on the serial port after removing the CR and LF characters
More information about the Python-list