def check_file_output(filename, force):
 console.logger.debug('Checking file output')
 if (os.path.isfile(filename) and (not force)):
  answer = console.ask('File {0} already exists! Overwrite it? [y/N] ', filename)
  if (answer.lower() != 'y'):
   sys.exit()
 return FileOutput(filename)

def check_file_output ( filename , force ) : console . logger . debug ( 'Checking file output' ) if ( os . path . isfile ( filename ) and ( not force ) ) : answer = console . ask ( 'File {0} already exists! Overwrite it? [y/N] ' , filename ) if ( answer . lower ( ) != 'y' ) : sys . exit ( ) return FileOutput ( filename )
checks if file already exists and ask the user if it should be overwritten if it does .