Skip to content

Instantly share code, notes, and snippets.

@BeanBagKing
Created October 20, 2016 15:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save BeanBagKing/d6804c8b0fbb855a95c9c60d7f43e438 to your computer and use it in GitHub Desktop.
Save BeanBagKing/d6804c8b0fbb855a95c9c60d7f43e438 to your computer and use it in GitHub Desktop.
Takes a URL encoded file (such as a TCP stream) and decodes it.
#!/usr/bin/python
import urllib
fin = open("urlencoded.txt")
fout = open("urldecoded.txt", "wt")
for line in fin:
fout.write(urllib.unquote(line))
fin.close()
fout.close()
@BeanBagKing
Copy link
Author

Lots of examples on how to do this with strings. I couldn't find a single one that performed the action on an entire file though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment