Skip to content

Instantly share code, notes, and snippets.

Last active July 26, 2018 17:16
What would you like to do?
from urllib import urlretrieve
from zipfile import ZipFile
from os.path import isfile
ZIP_URL = ''
ZIP_PATH = '/tmp/'
if not isfile(ZIP_PATH):
urlretrieve(ZIP_URL, ZIP_PATH)
ZFILE = ZipFile(ZIP_PATH, 'r')
for name in ZFILE.namelist():
if ".csv" in name and len(CONTENT) < 1:
EX_FILE = # this is a file like object
CONTENT ='\n')
if len(CONTENT) > 0:
for line in CONTENT[:500]:
if line is not "":
(d_id, domain) = line.split(',')
print "id: %s, domain: %s" % (d_id, domain)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment