Sorry Shi Mu, don't understand the question. So, you're successfull opening a file. Now, you need to read it
for line in fsock: print line or fsockData = fsock.read() or nextLine = fsock.readline() Have a play with those. On 11/12/05, Shi Mu <[EMAIL PROTECTED]> wrote: > I got the output as: > >>> > Yes!!! This line will always print > from the code: > try: > fsock = open("c:/TEMP/hello.txt") > except IOError: > print "The file does not exist, exiting gracefully" > print "Yes!!! This line will always print" > > it means the code found there is hello.txt, > why it does not show on the output. > _______________________________________________ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor > _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor