Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
.. image:: https://travis-ci.org/MisanthropicBit/progress.svg?branch=prop_exts :target: https://travis-ci.org/MisanthropicBit/progress
.. image:: https://pypip.in/license/progress2/badge.png :target: https://pypi.python.org/pypi/progress2/
Allows for easy creation of progress-bars and text.
progress
has been tested with Python 2.6, 2.7, 3.2, 3.3 and PyPy, and as of now requires at least Python 2.6
Note: PyPI already contains a progress
entry, so this module is located
at progress2 <https://pypi.python.org/pypi/progress2>
_.
You can install via pip <https://pip.pypa.io/en/latest/>
_::
pip install progress2
Alternatively, download the source files and run the following command from the download directory::
python setup.py install
Creating a ProgressBar
:
>>> import progress
>>> bar = progress.ProgressBar("[{progress}] {percentage:.2f}% ({minutes}:{seconds})", width=30)
>>> bar.show()
[ ] 0.00% (0:0)>>>
>>> bar.update(26)
>>> bar.show()
[======> ] 26.00% (0:0)>>>
>>>
Alternatively, you can use the autoupdate
method:
>>> bar.autoupdate(42)
[===================> ] 68.00% (0:45)>>>
>>>
Creating a ProgressText
:
>>> text = progress.ProgressText("Searching: {progress}", "|/-\\", autoreset=True)
>>> text.show()
|>>>
>>> text.update(); text.show()
/>>>
>>> text.update(); text.show()
->>>
>>> text.update(); text.show()
\>>>
You can supply custom args and kwargs to show
and autoupdate
:
>>> bar = progress.ProgressBar("[{progress}] {key} {},{},{}")
>>> d = dict(key=33)
>>> l = range(3)
>>> bar.update(50)
>>> bar.show(*l, **d)
[=========> ] 33 0,1,2>>>
>>> bar.autoupdate(25, *l, **d)
[==============> ] 33 0,1,2>>>
>>>
Refer to the examples/
directory for more examples. There are also examples
of how to use progress
with the threading
module.
Since most terminals cannot clear their output buffers across newlines or carriage returns,
progress
does not work if you insert them, e.g. progress.ProgressBar("{progress}\n{percentage}")
will not be cleared from the terminal.
FAQs
Allows for easy creation of progress-bars and text
We found that progress2 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.