Is there a way to limit size of a list in Python, so it does not use all memory?
bumsfeld 413 Nearly a Posting Virtuoso
Recommended Answers
Jump to PostThanks G-Do for your information, so NumPy eventually replaces Numeric and Numarray. Interesting!
When I was coding in C, I used to sample lab data and put it into a circular or ring buffer to keep the thing from overflowing. This was an easy way to calculate a moving …
Jump to PostWhy not something like:
if len(mylist) > 5:
...del mylist[0]Good idea, but if mylist is appended to in several different places in your code than it would not be very practical.
All 5 Replies
G-Do 19 Junior Poster
vegaseat 1,735 DaniWeb's Hypocrite Team Colleague
bumsfeld 413 Nearly a Posting Virtuoso
wrybread 0 Newbie Poster
vegaseat 1,735 DaniWeb's Hypocrite Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.