def rewrite_file(filename):
 with open(filename, 'rU') as file_obj:
  content_lines = file_obj.read().split('\n')
 new_content = []
 for line in content_lines:
  new_content.append(transform_line(line))
 with open(filename, 'w') as file_obj:
  file_obj.write('\n'.join(new_content))

def rewrite_file ( filename ) : with open ( filename , 'rU' ) as file_obj : content_lines = file_obj . read ( ) . split ( '\n' ) new_content = [ ] for line in content_lines : new_content . append ( transform_line ( line ) ) with open ( filename , 'w' ) as file_obj : file_obj . write ( '\n' . join ( new_content ) )
rewrites a given pb2 modules .