Commit 69e96fc4 authored by Russell Luke's avatar Russell Luke
Browse files

figureing out zip files

parent aaa4f6f0
......@@ -2,6 +2,7 @@ from pathlib import Path
import sys
import urllib.request
import tarfile
import zipfile
#shows progress of download
def dlProgress(counter, blocksize, size):
......@@ -42,10 +43,10 @@ def getData(problemFamily):
if query_yes_no("Do you want to download the " + problemFamily + " input data?"):
urllib.request.urlretrieve(" https://github.com/veitelser/phase-retrieval-benchmarks/archive/master.zip","../InputData/" + problemFamily + ".zip", reporthook=dlProgress)
print("\nExtracting data...")
tar = tarfile.open("../InputData/" + problemFamily + ".zip", "r")
tar.extractall("../InputData/Phase/" + problemFamily)
tar.close()
with ZipFile('../InputData/Elser.zip') as myzip:
myzip.extractall("../InputData/Phase/" + problemFamily)
os.system("mv ../../../InputData/Phase/Elser/phase-retrieval-benchmarks-master/data/* ../../../InputData/Phase/Elser/")
os.system("rm -r ../../../InputData/Phase/Elser/phase-retrieval-benchmarks-master")
elif query_yes_no("Do you want to download the " + problemFamily + " input data?"):
urllib.request.urlretrieve(" http://vaopt.math.uni-goettingen.de/data/" + problemFamily + ".tar.gz","../InputData/" + problemFamily + ".tar.gz", reporthook=dlProgress)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment