I have this code:
while i<len(line):
if re.findall(pattern, line[i]):
k,v = line[i].split('=')
print k
token = dict(k=v)
print token
break
and the result I’m getting is :
ptk
{'k': 'ptk_first'}
how to make this few lines of code nicer and dictionary that will look like this:
{'ptk': 'ptk_first'}
for your code: