Gerard Flanagan wrote: > Now I can do this: > > page = HtmlPage('Test Page') > navbar = page.div(id='left').ul(css='navbar') > for href,link in {'/home':'Home', '/shop':'Shop', > '/cart':'Cart'}.iteritems(): > navbar.li.a(link,href=href) > page.div(id='main').h1('Header').p('<Text Goes Here>') > > So *that's* what '__call__' does - I am enlightened!
just wait until you figure out what iteritems do ;-) ::: I'm sure you already know it, but dictionaries aren't ordered, so that navigation bar may not come out as you'd expect. >>> {"/home": "Home", "/shop": "Shop", "/cart": "Cart"} {'/cart': 'Cart', '/shop': 'Shop', '/home': 'Home'} </F> -- http://mail.python.org/mailman/listinfo/python-list