import urllib print urllib.quote_plus("http://www.yahoo.com/") print urllib.quote_plus("Kruder & Dorfmeister")
It is easy to be drawn to the
urlencode function in
urllib module documentation. But for simple
quote is needed. I believe this is the
appropriate solution to
Python urlencode annoyance and
O'Reilly's Amazon Hack #92.
For reference: Percent-encoding on Wikipedia
Nice music exemple :)
xav, it's not actually mine, but glad you liked it.
Thank you for the sample - seems to pull fewer resources than a full urlencode