Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python

Levis Vazquez
Levis Vazquez
961 Points

How do I add a progress bar to my script (Python 3.5)

Hi, I have a script that downloads a . zip file from the internet, the file takes sometime to download so I would like to have a progress bar while it's downloading and when it finish unzip the file to a folder in 'C:\, then deletes the .zip. Here is my script so far, any help will be greatly appreciate.

import urllib.request while True: print("Downloading File") break url = urllib.request.urlretrieve('www.google.com/filename.zip', 'C:/users/home/filename.zip')

1 Answer

Tony Gu
Tony Gu
8,789 Points

Here are a couple of options that I know:

  1. progress - Easy to use progress bars for Python https://github.com/verigak/progress/

  2. clint - Command Line INterface Tools - by the author of Requests https://github.com/kennethreitz