[Claude]
> I have a huge list of URLs. These URLs all have ASCII codes for special
> characters, like "%20" for a space or "%21" for an exclamation mark.
You need urllib.unquote:
>>> import urllib
>>> help(urllib.unquote)
Help on function unquote in module urllib:
unquote(s)
unquote('abc%20
Claude Henchoz wrote:
> Hi guys
>
> I have a huge list of URLs. These URLs all have ASCII codes for special
> characters, like "%20" for a space or "%21" for an exclamation mark.
>
> I've already googled quite some time, but I have not been able to find
> any elegant way on how to replace these w
Thanks guys, I like the urllib solution. Stupid me, looked at urllib
reference, but thought that "quote" and "unquote" deal with
_&_n_b_s_p_;_ style entities.
--
http://mail.python.org/mailman/listinfo/python-list
My outline for a solution would be:
- Use StringIO or cStringIO for reading the original URLs character for
character, and to build the result URLs character for character
- When you read a '%' then read the next 2 character (should be
digits!!!) and create a new string with them
- The numbers li
Claude Henchoz wrote:
> I have a huge list of URLs. These URLs all have ASCII codes for special
> characters, like "%20" for a space or "%21" for an exclamation mark.
>
> I've already googled quite some time, but I have not been able to find
> any elegant way on how to replace these with their 're
Claude Henchoz wrote:
> I have a huge list of URLs. These URLs all have ASCII codes for special
> characters, like "%20" for a space or "%21" for an exclamation mark.
>
> I've already googled quite some time, but I have not been able to find
> any elegant way on how to replace these with their 'r
Hi guys
I have a huge list of URLs. These URLs all have ASCII codes for special
characters, like "%20" for a space or "%21" for an exclamation mark.
I've already googled quite some time, but I have not been able to find
any elegant way on how to replace these with their 'real' counterparts
(" " a