Hi, this should be a fairly straightforward problem but I'm still getting to grips with programming.
What I wish to do is to search for a string in an xml file using python and then for it to say True or False, depending on whether the string appears within the file or not.
At the moment I've got this:
>>> datafile = file('data.xml')
>>> for line in datafile:
... if '168439992' in line:
... print 'True'
... print 'False'
So at the moment it goes through each line in the xml file and says whether the string appears or not, whereas I would like it only to say True or False just once.
Thanks in advance