def getFileText(fileName, printWarning=True, readMode='r'):
 try:
  file = open(fileName, readMode)
  fileText = file.read()
  file.close()
  return fileText
 except IOError:
  if printWarning:
   print (('The file ' + fileName) + ' does not exist.')
 return ''

def getFileText ( fileName , printWarning = True , readMode = 'r' ) : try : file = open ( fileName , readMode ) fileText = file . read ( ) file . close ( ) return fileText except IOError : if printWarning : print ( ( 'The file ' + fileName ) + ' does not exist.' ) return ''
get the entire text of a file .