Search code examples
pythonply

Can PLY process input without loading it all into memory?


I'd like to use Python's PLY to analyze a huge portion of text, that could reach 1GB in size.

Is it possible to have PLY read the text and parse it as a stream, so I wouldn't have to load the whole thing into memory? I want to go over the text line-by-line, and have PLY analyze it. Is that possible?


Solution

  • Looks like PLY uses Python's re module which can't handle a stream, therefore it can't handle a stream as well.