Popular recipes tagged "curses"http://code.activestate.com/recipes/tags/curses/2014-07-12T07:29:59-07:00ActiveState Code RecipesPython Awesome DD (Python)
2014-07-12T07:29:59-07:00Mike 'Fuzzy' Partinhttp://code.activestate.com/recipes/users/4179778/http://code.activestate.com/recipes/578907-python-awesome-dd/
<p style="color: grey">
Python
recipe 578907
by <a href="/recipes/users/4179778/">Mike 'Fuzzy' Partin</a>
(<a href="/recipes/tags/curses/">curses</a>, <a href="/recipes/tags/dd/">dd</a>, <a href="/recipes/tags/file/">file</a>, <a href="/recipes/tags/input/">input</a>, <a href="/recipes/tags/output/">output</a>, <a href="/recipes/tags/progress_bar/">progress_bar</a>).
Revision 3.
</p>
<p>Imagine if the *nix utilities 'dd', 'wget', and 'pv' had a baby. That baby would be named 'padd'. A 'dd' replacement (most commonly used options translate with no problem), that gives progress output like 'pv' and supports (currently) http(s) and ftp input sources, with more planned (sftp for one). Output support for ftp, sftp, and http(s) is also planned.</p>
Progress bar class (Python)
2012-08-09T17:39:10-07:00Xavier L.http://code.activestate.com/recipes/users/4171602/http://code.activestate.com/recipes/578228-progress-bar-class/
<p style="color: grey">
Python
recipe 578228
by <a href="/recipes/users/4171602/">Xavier L.</a>
(<a href="/recipes/tags/class/">class</a>, <a href="/recipes/tags/cli/">cli</a>, <a href="/recipes/tags/curses/">curses</a>, <a href="/recipes/tags/files/">files</a>, <a href="/recipes/tags/module/">module</a>, <a href="/recipes/tags/progress/">progress</a>).
Revision 5.
</p>
<p>See <a href="https://gist.github.com/3306295">gist:3306295</a> for future developments.</p>
<p>Here is a little class that lets you present percent complete information in the form of a progress bar using the '=' character to represent completed portions, spaces to represent incomplete portions, '>' to represent the current portion and the actual percent done (rounded to integer) displayed at the end:</p>
<p>[===========> ] 60%</p>
<p>When you initialize the class, you specify the minimum number (defaults to 0), the maximum number (defaults to 100), and the desired width of the progress bar. The brackets <code>[]</code> are included in the size of the progress bar, but you must allow for up to 4 characters extra to display the percentage.</p>
<p>You'd probably want to use this in conjuction with the curses module, or something like that so you can over-write the same portion of the screen to make your updates 'animated'.</p>
Simple curses based MySQL 'top' (Python)
2011-11-02T20:28:48-07:00Mike 'Fuzzy' Partinhttp://code.activestate.com/recipes/users/4179778/http://code.activestate.com/recipes/577936-simple-curses-based-mysql-top/
<p style="color: grey">
Python
recipe 577936
by <a href="/recipes/users/4179778/">Mike 'Fuzzy' Partin</a>
(<a href="/recipes/tags/curses/">curses</a>, <a href="/recipes/tags/database/">database</a>, <a href="/recipes/tags/mysql/">mysql</a>, <a href="/recipes/tags/time/">time</a>).
Revision 3.
</p>
<p>This is little more than a modification of my previous recipe, however, I found it useful so I thought I would post it in the hopes that someone else would as well. There is color (BOLD white really) designation for 'Query' states vs others like 'Sleep'. </p>
DistCC 'top' (Python)
2013-12-01T11:19:56-08:00Mike 'Fuzzy' Partinhttp://code.activestate.com/recipes/users/4179778/http://code.activestate.com/recipes/577933-distcc-top/
<p style="color: grey">
Python
recipe 577933
by <a href="/recipes/users/4179778/">Mike 'Fuzzy' Partin</a>
(<a href="/recipes/tags/color/">color</a>, <a href="/recipes/tags/curses/">curses</a>, <a href="/recipes/tags/distcc/">distcc</a>, <a href="/recipes/tags/distributed/">distributed</a>, <a href="/recipes/tags/monitor/">monitor</a>, <a href="/recipes/tags/pack/">pack</a>, <a href="/recipes/tags/struct/">struct</a>, <a href="/recipes/tags/top/">top</a>, <a href="/recipes/tags/unpack/">unpack</a>).
Revision 3.
</p>
<p>A small recipe for a curses based, 'top'-like monitor for DistCC. I know there is already distccmon-text, but I don't like it, and much prefer this sytle of monitoring. Note that I don't keep hosts around in the list like distccmon-gui/gnome. The screen is drawn for exactly what is currently in state. The terminal size is respected at initialization time, however resize events aren't handled. There is color designation of job types.</p>
Binary BCD clock using curses (Python)
2010-10-19T10:40:36-07:00Michal Niklashttp://code.activestate.com/recipes/users/186902/http://code.activestate.com/recipes/577430-binary-bcd-clock-using-curses/
<p style="color: grey">
Python
recipe 577430
by <a href="/recipes/users/186902/">Michal Niklas</a>
(<a href="/recipes/tags/curses/">curses</a>, <a href="/recipes/tags/time/">time</a>).
</p>
<p>Converts actual time to vertical BCD digits. So actual time, 12:37:51 looks like:</p>
<pre class="prettyprint"><code>......
...**.
.***..
*.****
</code></pre>