Re: Executing other python code

2008-01-29 Thread Martin Skou
Over-simplified yes, but it will work! Python is beautiful :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: text-mode tree viewer?

2007-06-26 Thread Martin Skou
Torsten Bronger wrote: > > It doesn't show Paul and Mary on the same level. I (think I) solved > the problem with this: > I could do so if Poul was in a list of his own, like "Arthur" and "Clara". /Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: text-mode tree viewer?

2007-06-26 Thread Martin Skou
Not quite, but almost: data=[["Peter", ["Ian", [["Randy", ["Clara"], "Paul", ["Mary", ["Arthur"]]] def show(data,level): for i in data: if i.__class__.__name__=='list': show(i,level

Re: python website

2007-06-20 Thread Martin Skou
The Daily Python-URL http://www.pythonware.com/daily/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Internationalised email subjects

2007-06-20 Thread Martin Skou
From: http://docs.python.org/lib/module-email.header.html >>> from email.message import Message >>> from email.header import Header >>> msg = Message() >>> h = Header('p\xf6stal', 'iso-8859-1') >>> msg['Subject'] = h >>> print msg.as_string() Subject: =?iso-8859-1?q?p=F6stal?= /Martin -- h

Re: Encoding problem with web application (Paste+Mako)

2007-06-06 Thread Martin Skou
Rob Wolfe wrote: > > You have to know the encoding of user input and then you > can use ``input_encoding`` and ``output_encoding`` parameters > of ``Template``. Mako internally handles everything as Python unicode > objects. > For example: > > t = Template(filename="templ.mako", input_encoding="i

Inheritance in nested classes

2005-11-15 Thread Martin Skou
I'm experimenting with using Python for a small web interface, using Mark Hammond's nice win32 extensions. I use a small class hierarchy which uses inheritance and nested classes. Here are a small extract of the code: class page: def __init__(self): self.head=[]