Web Analytics Made Easy - Statcounter
Skip to content

One Line Progress Meter (Popup Windows 4 of 4)

OneLineProgressMeter call reference

import PySimpleGUI as sg

for i in range(0, 5000):
    sg.one_line_progress_meter("The most simple progress meter possible", i, 4999)

one_line_progress_meter

Rather than staring at a blank screen or a static window that says "downloading", why not give your user an window that shows the progress as well as an estimated amount of time remaining? The one_line_progress_meter function does it all in 1 line, including having a name that tells you what it is.

This popup is designed to be the easiest progress meter function call ever made. No kidding. The requirement for this feature was that you shouldn't need to do any initialization outside your loop and shouldn't need to modify your loop itself beyond making this function call.

There are 3 basic parameters...

  1. The title for the window
  2. The current counter
  3. The maximum counter value

Canceling

This meter is also designed so that you can use it to abort your loop. You'll learn how to use the cancel button in the later sections that detail the one-line-progress-meter.

Try It For Yourself