Repeatedly appending to a large list (Python 2.6.6)

前端 未结 5 712
小蘑菇
小蘑菇 2020-12-29 05:30

I have a project where I am reading in ASCII values from a microcontroller through a serial port (looks like this : AA FF BA 11 43 CF etc) The input is coming in quickly (38

5条回答
  •  无人及你
    2020-12-29 06:22

    One thing you might want to consider is writing your data to a file as it's collected. I don't know (or really care) if it will affect performance, but it will help ensure that you don't lose all your data if power blips. Once you've got all the data, you can suck it out of the file and jam it in a list or an array or a numpy matrix or whatever for processing.

提交回复
热议问题