human
How do I url encode in Python?
assistant
Here is some code to replace special characters in url 'http://spam.com/go/' using the '%xx' escape

urllib.parse.quote('http://spam.com/go/')

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.