Home  >  Magazine  >  #73 May 2000  >  Python Programming for Beginners  >  Listing 6. Opening a Read File
Wednesday, March 29, 2000 | Last Updated 03:42:41 PM


  

Listing 6. Opening a Read File

#! /usr/local/bin/python
import sys
try:
        fi = open('sample_+_file', 'r')
except IOError:
        print 'Can\'t open file for reading.'
        sys.exit(0)