Skip to content

Instantly share code, notes, and snippets.

@rschiang
Created June 16, 2014 03:30
Show Gist options
  • Save rschiang/8cad674bb41160062c05 to your computer and use it in GitHub Desktop.
Save rschiang/8cad674bb41160062c05 to your computer and use it in GitHub Desktop.
Batch process zip code
#!/usr/bin/python
# sudo pip install zipcodetw
from codecs import open
import zipcodetw
i = open('address.txt', 'r', encoding='utf-8')
o = open('address_a.txt', 'w+', encoding='utf-8')
for addr in i:
o.write('%s %s\n' % (zipcodetw.find(addr), addr))
i.close()
o.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment