![]() |
|
[Python] Progress bar - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Python] Progress bar (/showthread.php?tid=5909823) |
Progress bar - Freed0m36 - Nov 19, 2018 I am writing a python web scraper which will use a document with a list of url's to scrape, scrape the data I want and then write it to a file. The list contains 24 url's and I am using "sleep" a few time in my functions to make sure not to overflow the websites with requests.. I want to implement a progress bar like "TQDM". but I am not sure how to use it. Everywhere I look, they give examples with "for" loops and I'm not sure where to place that loop in my code to have a Global progress overview. If anyone has experience with TQDM ( or any other progress bar module ) and the skills to solve my problem, any help will be appreciated. RE: Progress bar - Qismon - Nov 20, 2018 This should work fine. Code import progressbarRE: Progress bar - DopplerAF - Nov 20, 2018 I don't have clear idea about what you are asking about but I have done something which might help you. Code from bs4 import BeautifulSoupRE: Progress bar - PoP-Hacker - Nov 21, 2018 import time import sys toolbar_width = 40 sys.stdout.write("[%s]" % (" " toolbar_width)) sys.stdout.flush() sys.stdout.write("\b" (toolbar_width+1)) for i in range(toolbar_width): time.sleep(0.1) sys.stdout.write(">") sys.stdout.flush() sys.stdout.write("\n") RE: Progress bar - StreetSquirrel - Nov 21, 2018 (Nov 21, 2018 12:03 PM)PoP-Hacker Wrote: import time [*code] [*/code] RE: Progress bar - PoP-Hacker - Nov 21, 2018 (Nov 21, 2018 12:37 PM)StreetSquirrel Wrote: [*code] [*/code] ? RE: Progress bar - Infamia - Nov 21, 2018 (Nov 21, 2018 12:03 PM)PoP-Hacker Wrote: import time unnecessarily using `sys.stdout.write` is pointless. RE: Progress bar - PoP-Hacker - Nov 22, 2018 (Nov 21, 2018 03:02 PM)Infamia Wrote: unnecessarily using `sys.stdout.write` is pointless. HAHA You not well done me but small problem in replay me |