code: def write_file(self, filename, cart_coords=False):
          
          with zopen(filename, "w") as f:
              f.write(self.to_string(cart_coords))
docs: Write the input string into a file
  
          Option: see __str__ method