The first line of my input file looks like this:
<doc id="12" url="http://en.wikipedia.org/wiki?curid=12" title="Anarchism">
I want store them as key-value pair like this in python:
{doc_id: 12, url: http://en.wikipedia.org/wiki?curid=12, title: Anarchism}
Here is my code:
infile=open('wiki_00').readline().rstrip()
infile.split()[1:]
output looks like this:
['id="12"',
'url="http://en.wikipedia.org/wiki?curid=12"',
'title="Anarchism">']
But I would like the "", <> removed and id to be stored as type int