David Douard wrote: > Marcel van den Dungen wrote: > >> alex wrote: >>> Hi, >>> >>> I am a beginner with python and here is my first question: >>> How can I read the contents of a file using a loop or something? I open >>> the file with file=open(filename, 'r') and what to do then? Can I use >>> something like >>> >>> for xxx in file: >>> .... >>> >>> >>> Thanks for help >>> Alex >>> >> take a look at this: >> http://www.devshed.com/c/a/Python/File-Management-in-Python/ >> >> HTH, >> -- Marcel > > Or even have a look at the excellent Gnosis book on the subject (and very > much more further, but...): > http://gnosis.cx/TPiP/ which is freely available in text format. > > David
Just to tell (it's not clear at all in my message): the author of the book and creator of Gnosis Software is David Mertz, and the book is published by Addison Wesley. Sorry David -- http://mail.python.org/mailman/listinfo/python-list