Created
February 6, 2012 06:13
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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