I am a newbie with Python and I search how to parse a .txt file. My .txt file is a namelist with computation informations like :
myfile.txt
If there are multiple comma-separated values on a single line, here's code to parse that out:
res = {} pairs = args.split(", ") for p in pairs: var, val = p.split("=") res[var] = val