# L-28 MCS 260 Wed 31 Oct 2007 : readfilename.py # # Prompts the user for a file name and displays # an error message if the name given by the user # does not correspond to a file. name = raw_input('Give the name of a file : ') try: file = open(name,'r') print 'opened ' + name + ' for reading' file.close() except IOError: print 'file ' + name + ' does not exist?'