Skip to content

Instantly share code, notes, and snippets.

View zwehrwein's full-sized avatar

Zach Wehrwein zwehrwein

  • Harvard Medical School
  • Cambridge MA
View GitHub Profile

Keybase proof

I hereby claim:

  • I am zwehrwein on github.
  • I am zwehrwein (https://keybase.io/zwehrwein) on keybase.
  • I have a public key ASDLj4Ziir0FV3PLa4ow__FWiYpZFf-htZbra3L2EPukzAo

To claim this, I am signing this object:

@zwehrwein
zwehrwein / print_progress.py
Created January 31, 2018 01:23 — forked from ravishchawla/print_progress.py
A python function that can be used to print an ongoing progress bar.
import sys;
def print_progess(currentProgress, maxProgress, numberDashes, message = ""):
progress = numberDashes * (currentProgress / maxProgress) + 1;
dashes = "=" * int(progress) + "> "
percentage = int(100 * currentProgress / maxProgress) + 1;
if percentage > 100:
percentage = 100;
sys.stdout.write("\r " + "<" + message + "> " + dashes + "{0:.2f}".format(percentage) + "%");
sys.stdout.flush();
@zwehrwein
zwehrwein / print_progress.py
Created January 31, 2018 01:23 — forked from ravishchawla/print_progress.py
A python function that can be used to print an ongoing progress bar.
import sys;
def print_progess(currentProgress, maxProgress, numberDashes, message = ""):
progress = numberDashes * (currentProgress / maxProgress) + 1;
dashes = "=" * int(progress) + "> "
percentage = int(100 * currentProgress / maxProgress) + 1;
if percentage > 100:
percentage = 100;
sys.stdout.write("\r " + "<" + message + "> " + dashes + "{0:.2f}".format(percentage) + "%");
sys.stdout.flush();
@zwehrwein
zwehrwein / print_progress.py
Created January 31, 2018 01:23 — forked from ravishchawla/print_progress.py
A python function that can be used to print an ongoing progress bar.
import sys;
def print_progess(currentProgress, maxProgress, numberDashes, message = ""):
progress = numberDashes * (currentProgress / maxProgress) + 1;
dashes = "=" * int(progress) + "> "
percentage = int(100 * currentProgress / maxProgress) + 1;
if percentage > 100:
percentage = 100;
sys.stdout.write("\r " + "<" + message + "> " + dashes + "{0:.2f}".format(percentage) + "%");
sys.stdout.flush();
@zwehrwein
zwehrwein / print_progress.py
Created January 31, 2018 01:23 — forked from ravishchawla/print_progress.py
A python function that can be used to print an ongoing progress bar.
import sys;
def print_progess(currentProgress, maxProgress, numberDashes, message = ""):
progress = numberDashes * (currentProgress / maxProgress) + 1;
dashes = "=" * int(progress) + "> "
percentage = int(100 * currentProgress / maxProgress) + 1;
if percentage > 100:
percentage = 100;
sys.stdout.write("\r " + "<" + message + "> " + dashes + "{0:.2f}".format(percentage) + "%");
sys.stdout.flush();
@zwehrwein
zwehrwein / print_progress.py
Created January 31, 2018 01:23 — forked from ravishchawla/print_progress.py
A python function that can be used to print an ongoing progress bar.
import sys;
def print_progess(currentProgress, maxProgress, numberDashes, message = ""):
progress = numberDashes * (currentProgress / maxProgress) + 1;
dashes = "=" * int(progress) + "> "
percentage = int(100 * currentProgress / maxProgress) + 1;
if percentage > 100:
percentage = 100;
sys.stdout.write("\r " + "<" + message + "> " + dashes + "{0:.2f}".format(percentage) + "%");
sys.stdout.flush();