variable substitution

Hugh h.e.w.frater at cs.cf.ac.uk
Wed Apr 24 09:19:55 EDT 2002


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



More information about the Python-list mailing list