<div class="gmail_quote">On Fri, Nov 20, 2009 at 12:14 PM, Shashank Singh <span dir="ltr"><<a href="mailto:shashank.sunny.singh@gmail.com">shashank.sunny.singh@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Are you sure your key values are 2-tuples in levelDict?<br></blockquote><div><br>No. Here's some tweaked code:<br><br> cursor.execute('select category from categories order by category')<br> theTree = expand(cursor.fetchall())<br>
print theTree<br><br>Now, categories only has one category called 'cat1'. Here's what it prints:<br><br>{'cat1': {}}
<br><br>Now what I don't understand about the above code, provided by Dennis Lee Bieber, is the "expand" statement. Nor could I find any documentation googling either "expand python" or "expand fetchall python". Could someone please explain what this code does?<br>
TIA,<br>V<br></div></div>