Skip to content

Instantly share code, notes, and snippets.

@ipl31
Created February 6, 2012 06:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ipl31/1750171 to your computer and use it in GitHub Desktop.
Save ipl31/1750171 to your computer and use it in GitHub Desktop.
python script that takes url encoded data in a file and decodes it
#!/usr/bin/env python
import urllib
encoded_filename = urllib.quote('post.txt')
decoded_filename = 'post.txt.decode'
source = open(encoded_filename)
dest = open(decoded_filename, 'w')
decoded_data = urllib.unquote_plus(source.read())
print decoded_data
dest.write(decoded_data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment