code: def readmol(path, as_string=False):
      
      supported_formats = ['pdb']
      # Fix for Windows-generated files: Remove carriage return characters
      if "\r" in path and as_string:
          path = path.replace('\r', '')
  
      for sformat in supported_formats:
          obc = pybel.ob.OBConversion()
          obc.SetInFormat(sformat)
          write_message("Detected {} as format. Trying to read file with OpenBabel...\n".format(sformat), mtype='debug')
  
          # Read molecules with single bond information
          if as_string:
              try:
                  mymol = pybel.readstring(sformat, path)
              except IOError:
                  sysexit(4, 'No valid file format provided.')
          else:
              read_file = pybel.readfile(format=sformat, filename=path, opt={"s": None})
              try:
                  mymol = next(read_file)
              except StopIteration:
                  sysexit(4, 'File contains no valid molecules.\n')
  
          write_message("Molecule successfully read.\n", mtype='debug')
  
          # Assign multiple bonds
          mymol.OBMol.PerceiveBondOrders()
          return mymol, sformat
  
      sysexit(4, 'No valid file format provided.')
docs: Reads the given molecule file and returns the corresponding Pybel molecule as well as the input file type.
      In contrast to the standard Pybel implementation, the file is closed properly.