Hi, I am in doubt :

>>> In = open(r'E:\MyDir\MyDoc.txt', 'rb')
>>> Out = open(r'E:\MyDir\MyUpperDoc.txt', 'wb')
>>> Out.write(In.read().upper())
>>> In.close()
>>> Out.close()

Pretty simple program. The question is : If 'In' is a HUGE file, how
does Python process it? Does it treat it as a stream and passes bytes to
'Out' as soon as they are coming in, or does it read the whole file into
memory and then passes the whole file to 'Out'?
If the answer is the first choice I would like to know how to instruct
Python to do the second choice.

TIA
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to