View Single Post
Posts: 272 | Thanked: 52 times | Joined on Jan 2010
#5
Originally Posted by pycage View Post
Something like this...

Code:
for result in data.split("|"):
  for line in result.split("\n"):
    idx = line.find(":")
    key = line[:idx]
    value = line[idx + 1:]
    print "%s: %s" % (key, value)
This looks like it does the job perfectly... although I'm not exactly sure what its doing fully.

Hopefully this kinda thing will come more naturally as I get better, this is only my first attempt!

Thanks