Created
November 1, 2017 10:54
-
-
Save nabeen/e22243d2c1c383a321684669a21efaca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
request = service.files().get_media(fileId=foo) | |
dirname = bar | |
name = baz | |
os.makedirs(dirname, 0o777, True) | |
fh = io.FileIO(os.path.join(dirname, name), mode='wb') | |
downloader = MediaIoBaseDownload(fh, request) | |
done = False | |
while done is False: | |
status, done = downloader.next_chunk() | |
print("Download %d%%." % int(status.progress() * 100)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment