variable substitution

Cameron Laird claird at starbase.neosoft.com
Wed Apr 24 10:38:01 EDT 2002


In article <e2e9e807.0204240519.688cf3cb at posting.google.com>,
Hugh <h.e.w.frater at cs.cf.ac.uk> wrote:
>How do I get the %(variable)s thing to work. I need to substitute a
>variable into a print statement so I can send links with sessionId's
>attached back to the browser. I'm trying this at the moment, and It
>says invalid sysntax.
>print '<a href = "addItemType.py?sessionID=%(sessionId)s">Add Item
>Type</a>'
>I saw this in a document written by Guido that I found here:
>http://www.w3j.com/6/s3.vanrossum.html
>
>
>hugh

That document looks to me to have been mangled.  Do <URL:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66018 >
and  <URL: http://
www.python.org/doc/1.5.2p2/tut/node9.html#SECTION009100000000000000000 >
help?

There ought to be a more canonical-but-readable Web reference
for what David Beazley calls the string "modulo operator"; I'm
open to suggestions.
-- 

Cameron Laird <Cameron at Lairds.com>
Business:  http://www.Phaseit.net
Personal:  http://starbase.neosoft.com/~claird/home.html



More information about the Python-list mailing list