Is there a way to read 10000 lines from a file in python?
- by windsound
I am relatively new in python, was working on C a lot. Since I was seeing so many new functions in python that I do not know, I was wondering if there is a function that can request 10000 lines from a file in python.
Something like this is what I expect if that kind of function exist:
lines = get_10000_lines(file_pointer)
Did python have a build-in function or is there any module that I can download for this?
If not, how do I do this to be easiest way. I need to analyze a huge file so I want to read 10000 lines and analyze per time to save memory.
Thanks for helping!