updated readme

This commit is contained in:
Casper da Costa-Luis 2015-06-15 10:19:02 +01:00 committed by Casper da Costa-Luis
parent e9ccb10310
commit 77c1d28159
1 changed files with 43 additions and 30 deletions

View File

@ -25,41 +25,47 @@ pip install -e git+https://github.com/tqdm/tqdm.git#egg=master
## Documentation ## Documentation
```python ```python
def tqdm(iterable, desc='', total=None, def tqdm(iterable, desc=None, total=None, leave=False, file=sys.stderr,
leave=False, file=sys.stderr, ncols=None, mininterval=0.1, miniters=1):
mininterval=0.5, miniters=1): """
"""Get an iterable object, and return an iterator which acts exactly like Decorate an iterable object, returning an iterator which acts exactly
the iterable, but prints a progress meter and updates it every time a like the orignal iterable, but prints a dynamically updating
value is requested. progressbar.
Parameters Parameters
---------- ----------
iterable: iterable iterable : iterable
Iterable to show progress for. Iterable to decorate with a progressbar.
desc: str, optional desc : str, optional
A short string, describing the progress, that is added in the beginning Prefix for the progressbar.
of the line. total : int, optional
total : int, optional The number of expected iterations. If not given, len(iterable) is
The number of expected iterations. If not given, len(iterable) is used used if possible. As a last resort, only basic progress statistics
if it is defined. are displayed.
file : `io.TextIOWrapper` or `io.StringIO`, optional file : `io.TextIOWrapper` or `io.StringIO`, optional
A file-like object to output the progress message to. By default, Specifies where to output the progress messages.
sys.stderr is used. leave : bool, optional
leave : bool, optional if unset, removes all traces of the progressbar upon termination of
If it is False (default), tqdm deletes its traces from screen after iteration [default: False].
it has finished iterating over all elements. ncols : int, optional
mininterval : float, optional The width of the entire output message. If sepcified, dynamically
If less than mininterval seconds have passed since the last progress resizes the progress meter [default: None]. The fallback meter
meter update, it is not updated again (default: 0.5). width is 10.
miniters : float, optional mininterval : float, optional
If less than miniters iterations have passed since the last progress Minimum progress update interval, in seconds [default: 0.5].
meter update, it is not updated again (default: 1). miniters : int, optional
Minimum progress update interval, in iterations [default: 1].
Returns
-------
out : decorated iterator.
""" """
def trange(*args, **kwargs): def trange(*args, **kwargs):
"""A shortcut for writing tqdm(xrange)""" """
return tqdm(xrange(*args), **kwargs) A shortcut for tqdm(xrange(*args), **kwargs).
On Python3+ range is used instead of xrange.
"""
``` ```
## Contributions ## Contributions
@ -83,3 +89,10 @@ $ make coverage
## Authors ## Authors
- noamraph (original author) - noamraph (original author)
- JackMc
- arkottke
- obiwanus
- fordhurley
- kmike
- hadim
- casperdcl