On Mon, 10 Dec 2012 08:36:22 -0800, moonhkt wrote: > Hi All > > I am new in Python. When using open and then for line in f . > > Does it read all the data into f object ? or read line by line ?
Have you read the Fine Manual? http://docs.python.org/2/library/stdtypes.html#file-objects If you have read it, and the answer is still not clear, then please tell us so we can improve the documentation. `for line in open(file, "r"):` does not read the entire file into memory at once, it iterates over the file reading one line at a time. -- Steven -- http://mail.python.org/mailman/listinfo/python-list