comparison data_manager/vsnp_genbank_fetcher.py @ 1:f136bf6d2f4c draft

Uploaded
author greg
date Mon, 10 Feb 2020 10:27:08 -0500
parents f1a7a3faaf3d
children
comparison
equal deleted inserted replaced
0:f1a7a3faaf3d 1:f136bf6d2f4c
15 src = None 15 src = None
16 dst = None 16 dst = None
17 try: 17 try:
18 req = Request(url) 18 req = Request(url)
19 src = urlopen(req) 19 src = urlopen(req)
20 with open(file_path, 'w') as dst: 20 with open(file_path, 'wb') as dst:
21 while True: 21 while True:
22 chunk = src.read(2**10) 22 chunk = src.read(2**10)
23 if chunk: 23 if chunk:
24 dst.write(chunk) 24 dst.write(chunk)
25 else: 25 else: