Browse Source

Progress Bar

pull/3/head
Jure Šorn 7 years ago
parent
commit
799014197d
1 changed files with 22 additions and 0 deletions
  1. 22
      README.md

22
README.md

@ -721,6 +721,7 @@ Libraries
Plot Plot
---- ----
```python ```python
# pip3 install matplotlib
from matplotlib import pyplot from matplotlib import pyplot
pyplot.plot(<data> [, <data>]) pyplot.plot(<data> [, <data>])
pyplot.show() pyplot.show()
@ -730,6 +731,7 @@ pyplot.savefig(filename)
Web Web
--- ---
```python ```python
# pip3 install bottle
import bottle import bottle
import urllib import urllib
``` ```
@ -776,6 +778,7 @@ def p_handler(sport):
Curses Curses
------ ------
```python ```python
# pip3 install curses
import curses import curses
def main(): def main():
@ -816,6 +819,7 @@ timeit('"-".join(str(n) for n in range(100))', number=10000)
#### Generates a PNG image of call graph and highlights the bottlenecks: #### Generates a PNG image of call graph and highlights the bottlenecks:
```python ```python
# pip3 install pycallgraph
import pycallgraph import pycallgraph
graph = pycallgraph.output.GraphvizOutput() graph = pycallgraph.output.GraphvizOutput()
graph.output_file = get_filename() graph.output_file = get_filename()
@ -875,7 +879,25 @@ class Progressbar():
sys.stdout.write("\n") sys.stdout.write("\n")
``` ```
```python
steps = 100
bar = Progressbar(steps)
for i in range(steps):
<code>
bar.tick()
```
#### Progress:
```python
# pip3 install progress
from progress.bar import Bar
steps = 100
bar = Bar('Processing', max=steps)
for i in range(steps):
<code>
bar.next()
bar.finish()
```

|||||||
100:0
Loading…
Cancel
Save