wasm-demo/demo/ermis-f/python_m/cur/0926

23 lines
533 B
Plaintext

From: philh at vision25.demon.co.uk (Phil Hunt)
Date: Fri, 30 Apr 99 01:30:12 GMT
Subject: %
Message-ID: <925435812snz@vision25.demon.co.uk>
X-UID: 926
Consider the % operator, eg:
'All %(a)s eat %(b)s' % {'a':'cows', 'b':'grass'}
If the dictionary doesn't have all the relevant keys, an error
occurs. Is it possible for me to change the behaviour of this so that
if a key doesn't occur a default value of '' is assumed?
--
Phil Hunt....philh at vision25.demon.co.uk