1 Reply Latest reply on Jun 21, 2010 9:55 PM by 390020

    Python Programming help please

      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
        • 1. Re: Python Programming help please
          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: http://diveintopython.org/xml_processing/
          ElementTree is part of the standard lib now so you can take full advantage of it. Please start reading from here:

          Good luck