line-by-line

reading from stdin, while consuming no more memory than needed

Hi. I am trying to create a line-by-line filter in python. However, stdin.readlines() reads all lines in before starting to process, and python runs out of memory (MemoryError). How can I have just one line in memory at a time? The kind of code I have: for line in sys.stdin.readlines(): if( filter.apply( line ) ): print(...

How can I profile python code line-by-line?

I've been using cProfile to profile my code, and it's been working great. I also use gprof2dot.py to visualize the results (makes it a little clearer). However, cProfile (and most other python profilers I've seen so far) seem to only profile at the function-call level. This causes confusion when certain functions are called from diffe...

What's the meaning of dotTrace's numbers in Line-By-Line profiling?

What do those numbers mean exactly? Times the line was hit? Microseconds per invocation? Or what? Also, what do the 'progress-bars' behind the numbers mean? They aren't even proportional to the numbers, so I'm really confused. ...