code: def convert_from_file(cls, input_file=None, output_file=None, output_format='json', indent=2, compact=False):
          
  
          if input_file is None:
              content = sys.stdin.read()
              config = ConfigFactory.parse_string(content)
          else:
              config = ConfigFactory.parse_file(input_file)
  
          res = cls.convert(config, output_format, indent, compact)
          if output_file is None:
              print(res)
          else:
              with open(output_file, "w") as fd:
                  fd.write(res)
docs: Convert to json, properties or yaml
  
          :param input_file: input file, if not specified stdin
          :param output_file: output file, if not specified stdout
          :param output_format: json, properties or yaml
          :return: json, properties or yaml string representation