title: Writing to file limitation on line length
body: <p>I've been trying to write lines to a file based on specific file names from the same directory, a search of the file names in another log file(given as an input), and the modified date of the files.
  The output is limiting me to under 80 characters per line.</p>
  
  <pre>
  
      def getFiles(flag, file):
  
          if (flag == True):
              file_version = open(file)
              if file_version:
                  s = mmap.mmap(file_version.fileno(), 0, access=mmap.ACCESS_READ)
              file_version.close()
  
          file = open('AllModules.txt', 'wb')
          for i, values in dict.items():
              # search keys in version file
              if (flag == True):
                  index = s.find(bytes(i))
                  if index > 0:
                      s.seek(index + len(i) + 1)
                      m = s.readline()
                      line_new = '{:>0}  {:>12} {:>12}'.format(i, m, values)
                      file.write(line_new)
                      s.seek(0)
              else:
                  file.write(i +'\n')
  
          file.close()
  
  
      if __name__ == '__main__':
          dict = {}
          for file in os.listdir(os.getcwd()):
              if os.path.splitext(file)[1] == '.psw' or os.path.splitext(file)[1] == '.pkw':
                  time.ctime(os.path.getmtime(file))
                  dict.update({str(os.path.splitext(file)[0]).upper():time.strftime('%d/%m/%y')})
          if (len(sys.argv) > 1) :
              if os.path.exists(sys.argv[1]):
                  getFiles(True, sys.argv[1])
          else:
              getFiles(False, None)
  
  </pre>
  
  <p>The output is always like:</p>
  
  <pre>
  
      BW_LIB_INCL         13.1 rev. 259 [20140425 16:28]
           16/05/14
  
  </pre>
  
  <p>The interpretation of data is correct, then again the formatting is not correct as the time is put on the next line (not on the same).
  This is happening to all the lines of my new file.</p>
  
  <p>Could someone give me a hint?</p>