Python about file I/O

Ken ken at hotmail.com
Sat Sep 21 05:07:28 CEST 2002


Hi, I have 2 questions on IO, not necessary related to one another:

1.) How do you list the filenames within a given directory so user can
choose which file to open?

2.) How do you ensure the program doesn't crash if I specify a filename to
open but the file doesn't exist? (I.E. how to check if file exist before
opening the file?)

Thanks





More information about the Python-list mailing list