Re: Logging data from Arduino using PySerial

2014-02-04 Thread MRAB
On 2014-02-04 04:07, Thomas wrote: I've written a script to log data from my Arduino to a csv file. The script works well enough but it's very, very slow. I'm quite new to Python and I just wanted to put this out there to see if any Python experts could help optimise my code. Here it is: [sn

Re: Logging data from Arduino using PySerial

2014-02-03 Thread Chris Angelico
On Tue, Feb 4, 2014 at 3:57 PM, Thomas wrote: > Wow...Thanks Chris! I really appreciate your suggestions (including the > stylistic ones). I'll definitely be revising my code as soon as I find the > time. As far as profiling goes, I've used timeit in the past but it's quite a > pain going throu

Re: Logging data from Arduino using PySerial

2014-02-03 Thread Thomas
Wow...Thanks Chris! I really appreciate your suggestions (including the stylistic ones). I'll definitely be revising my code as soon as I find the time. As far as profiling goes, I've used timeit in the past but it's quite a pain going through any program block by block. I wish there were a prog

Re: Logging data from Arduino using PySerial

2014-02-03 Thread Chris Angelico
On Tue, Feb 4, 2014 at 3:07 PM, Thomas wrote: > I've written a script to log data from my Arduino to a csv file. The script > works well enough but it's very, very slow. I'm quite new to Python and I > just wanted to put this out there to see if any Python experts could help > optimise my code.

Logging data from Arduino using PySerial

2014-02-03 Thread Thomas
I've written a script to log data from my Arduino to a csv file. The script works well enough but it's very, very slow. I'm quite new to Python and I just wanted to put this out there to see if any Python experts could help optimise my code. Here it is: import serial import re impor