Hi Guys, I am trying to do the following, and im not sure how to deal with a blob of text.
I have the following file i am using as a template %%NAME%% %%NUMBER%% %%REPORT%% and i have a corresponding file with values name="bob" number="123" report="report is long and spans multiple lines. It also is already in the exact format i want to replace the above template var %%REPORT%% with" The report part is obviously the problem. My code so far reads line by line and splits on the = and reads the values into a dict. file = open('test','r') data = {} for line in file: line = line.strip() line = line.split('=') data[line[0]] = line[1] My intention is then to replace the %%NAME%% with data['name'] etc. If it makes a difference, the report= will be generated by another program and given to me in the exact format i need to substitute it into %%REPORT%%. (or i can put it in that file). I hope this makes sense, thanks in advance - i really do appreciate it :) Stefan
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor