Commit b5afcb7d authored by Agnes Ansari's avatar Agnes Ansari
Browse files

Upload New File

parent 6a16c2f7
# Author: Alexandre Boucaud <>
# License: BSD 3 clause
from __future__ import print_function
import os
import sys
from urllib.request import urlretrieve
except ImportError:
from urllib import urlretrieve
URLBASE = '{}'
DATA = [
def main(path=None, output_dir='data'):
path = path or ""
fullpath = os.path.join(path, output_dir)
filenames = DATA
urls = [URLBASE.format(filename) for filename in filenames]
if not os.path.exists(fullpath):
for url, filename in zip(urls, filenames):
output_file = os.path.join(fullpath, filename.replace('_prace', ''))
if os.path.exists(output_file):
print("{} already downloaded".format(filename))
print("Downloading from {} ...".format(url))
urlretrieve(url, filename=output_file)
print("=> File saved as {}".format(output_file))
if __name__ == '__main__':
path = sys.argv[1]
except IndexError:
Supports Markdown
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