#NEWLINE# def write_file( filename , out_str ) : #NEWLINE# #INDENT# '\n    Write the content of out_str to filename.\n    ' #NEWLINE# try : #NEWLINE# #INDENT# out_file = open ( filename , 'w' ) #NEWLINE# out_file . write ( out_str ) #NEWLINE# out_file . close ( ) #NEWLINE# #UNINDENT# except IOError : #NEWLINE# #INDENT# sys . stderr . write ( '{0:s}: error: cannot write to file {1:s}\n' . format ( sys . argv [ 0 ] , filename ) ) #NEWLINE# sys . exit ( 1 )