1 import urllib 2 3 -def uriQuote(uri): 4 uri=str(uri) 5 for c in '%;/?:@&+$': 6 uri=uri.replace(c, '%%%02x'%ord(c)) 7 return uri 8 9 -def uriUnquote(q): 10 q=str(q) 11 return urllib.unquote(q) 12