Skip to content

A simple python module to create a colored progress bar and percentage in the script output to countdown between two dates.

License

Notifications You must be signed in to change notification settings

marcfrankel/Simple-Python-Date-ProgressBar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Simple Python Progress Bar for Dates V 1.2

A simple, native, cross-platform python file/module to allow for the easy creation of a countdown clock and colored progress bar between two dates. The file is fairly simple and can be easly modified to count between anything.

Prerequisites

  • Python 3
  • The module makes use of ASNI characters

How to Use

To use the Simple Python Progress Bar you can either simply download the progressBar.py file and place it in your python working directory or you can:

Clone the Git Repo

git clone https://github.com/marcfrankel/Simple-Python-Date-ProgressBar.git

Then also move the progressBar.py file into your python working directory

Importing

If the progressBar.py file is in the proper place you should be able to import the module with the following import statement at the top of your file

import progressBar

Creation

To create a progressBar in your code call progressBar.create() and pass in two datetime objects

response = progressBar.create(starting-Datetime-Object, ending-Datetime-Object)

The module will then create a progress bar that "hijacks" the program output. The progress bar will release control back to the main thread of the script when it either finishes or the KeyboardInterrupt error is thrown (user press control + c). To know the reason the progress bar stoped please see below.

Responses

the variable 'response' from above can be the following three ints and it is up to you how to handle them:

0 = The end date is before the start date. (No coutdown displayed)
1 = The countdown finished
2 = The user pressed control+c 

Built With

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

A simple python module to create a colored progress bar and percentage in the script output to countdown between two dates.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages