0

I get this error when trying to run python codes.

if p[0] == "$":
IndexError: string index out of range

Find my codes bellow


    parts = conf_line.split(",")
    for p in parts:
      if p[0] == "$":
        p = p[-1:]
      if "~" in p:
        p = p.split("~")[0]
      if "=" in p:
        p = p.split("=")[0]

      if len(p) == 40 and all(c in string.hexdigits for c in p):
        self.idhexes.add(p)
      elif p[0] == "{" and p[-1] == "}":
        self.countries.add(p[1:-1].lower())
      elif ":" in p or "." in p:

Any help will be greatly appreciated.

Thanks

Sammy
  • 45
  • 7

0 Answers0