Re: [Tutor] rewriting script

2007-09-08 Thread Alan Gauld
"Christopher Spears" <[EMAIL PROTECTED]> wrote >I have written a script that reads and displays text > files: > while True: >if os.path.exists(fname): >fobj = open(fname, 'r') >for eachLine in fobj: >print eachLine, >fobj.close() > However, whenever

Re: [Tutor] rewriting script

2007-09-07 Thread Steve Willoughby
Christopher Spears wrote: > I have written a script that reads and displays text > files: > > #!/usr/bin/env python > > 'readTextFile.py -- read and display text file' > > import os > > # get filename > while True: > fname = raw_input('Enter file name: ') > print > if os.path.exists