Re: [Tutor] elementtree, lists, and dictionaries

2005-02-17 Thread Luis N
Thanks that's much nicer. On Fri, 11 Feb 2005 22:28:55 -0500, Kent Johnson <[EMAIL PROTECTED]> wrote: > If you iterate over the author nodes you can check the user name and password > of each in turn. > > Not tested code! > > def authenticateAuthor(author, password): > authorxml = 'author.x

Re: [Tutor] elementtree, lists, and dictionaries

2005-02-12 Thread Kent Johnson
If you iterate over the author nodes you can check the user name and password of each in turn. Not tested code! def authenticateAuthor(author, password): authorxml = 'author.xml' path = os.path.join(xml, authorxml) if not os.path.exists(path): return False, False else:

[Tutor] elementtree, lists, and dictionaries

2005-02-11 Thread Luis N
Hi, This code works, but I don't like it much: def authenticateAuthor(author, password): authorxml = 'author.xml' path = os.path.join(xml, authorxml) try: if not os.path.exists(path): authorfile = False else: authorfile = True tree = E.ElementTree(file=path