"Kirk McDonald" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > If you have a link such as, e.g.: > > <a href="index.py?title=Main Menu">Main menu!</a> > > The space will be translated to the character code '%20' when you later > retrieve the GET data. > > I guess what I'm asking is: Is there a library function (in Python or > mod_python) that knows how to do this? Or, failing that, is there a > different regex I could use to get rid of the substitution function? > > -Kirk McDonald
>>> import urllib >>> urllib.quote("index.py?title=Main Menu") 'index.py%3Ftitle%3DMain%20Menu' >>> urllib.unquote("index.py%3Ftitle%3DMain%20Menu") 'index.py?title=Main Menu' -- http://mail.python.org/mailman/listinfo/python-list