Forum Stats

  • 3,781,234 Users
  • 2,254,495 Discussions


Python Programming help please

779796 Member Posts: 1
edited Jun 21, 2010 5:55PM in Python
Hi there,

I got this txt file with following contents:

<NAME>My Glossary</NAME>

The above text is saved in test.txt file.

I need to write a python script that would load the above file as list of strings. I then need display only the text from <Name> to </Name> in python.

If anybody can help me please with the code. I've tried searching a lot but haven't found anything.

Thank You


  • 390020
    390020 Member Posts: 446
    What you call a text file, it looks to me like a xml file :)
    There are plenty of useful resources in the web to help you out with this kind of common situation. One of the easiest explanations out there is Dive into Python by Mark Pilgrim:
    ElementTree is part of the standard lib now so you can take full advantage of it. Please start reading from here:

    Good luck
This discussion has been closed.