Hi

sorry if I'm asking something very obvious but I'm stumped. I have a
text that looks like this:

Sentence 401
4.00pm  — We set off again; this time via Tony's home to collect
a variety of possessions, finally arriving at hospital no.3.
Sentence 402
4.55pm  — Tony is ushered into a side ward with three doctors and
I stay outside with Mum.

And I want the HTML char codes to turn into their equivalent plain
text. I've looked at the newsgroup archives, the cookbook, the web in
general and can't manage to sort it out. I thought doing something like
this -

file = open('filename', 'r')
ofile = open('otherfile', 'w')

done = 0

while not done:
    line = file.readline()
    if 'THE END' in line:
        done = 1
    elif '—' in line:
        line.replace('—', '--')
        ofile.write(line)
    else:
        ofile.write(line)


would do it but it isn't....where am I going wrong?

many thanks
rachele

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to