def write_file(filename, contents):
 f = open(filename, 'w')
 try:
  for line in contents:
   f.write((line + '\n'))
 finally:
  f.close()

def write_file ( filename , contents ) : f = open ( filename , 'w' ) try : for line in contents : f . write ( ( line + '\n' ) ) finally : f . close ( )
write a number of random bytes to the file *path* .