Re: Trouble writing lines into file with line feeds- Python Newb

2013-12-23 Thread Jussi Piitulainen
daniel.t.he...@gmail.com writes: - - > 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. - - > while True: > rawcode=ser.readline() > codelog=open('/home/pi/avdms/codes.log','

Trouble writing lines into file with line feeds- Python Newb

2013-12-23 Thread daniel . t . healy
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: T