Popular recipes tagged "run"http://code.activestate.com/recipes/tags/run/2014-04-24T08:52:32-07:00ActiveState Code RecipesPython Unittest - Obtain the results of all the tests run as a list (Python)
2014-04-24T08:52:32-07:00Cosmin Niculaehttp://code.activestate.com/recipes/users/4189842/http://code.activestate.com/recipes/578866-python-unittest-obtain-the-results-of-all-the-test/
<p style="color: grey">
Python
recipe 578866
by <a href="/recipes/users/4189842/">Cosmin Niculae</a>
(<a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/run/">run</a>, <a href="/recipes/tags/tests/">tests</a>, <a href="/recipes/tags/unittest/">unittest</a>).
Revision 2.
</p>
<p>So far, there is no way of returning the results of the tests run with unittest in any form, except for having the results printed. The purpose of this code is to have the name of the test cases, their indexes, as well as the results (Pass, Fail, Error) as a list. This is extremely used when you want to create a table with the results, as it has all the information needed. </p>
<p>The affected file is the result.py in the unittest library folder.</p>
Run some command every x seconds (Python)
2013-09-24T13:26:19-07:00Rutger Saalminkhttp://code.activestate.com/recipes/users/4187940/http://code.activestate.com/recipes/578673-run-some-command-every-x-seconds/
<p style="color: grey">
Python
recipe 578673
by <a href="/recipes/users/4187940/">Rutger Saalmink</a>
(<a href="/recipes/tags/command/">command</a>, <a href="/recipes/tags/iterative/">iterative</a>, <a href="/recipes/tags/os/">os</a>, <a href="/recipes/tags/run/">run</a>).
</p>
<p>Sometimes it comes in handy to run some command every minute or hour. For example, have some process check your ip address every minute with 'ifconfig' or run some purgescript at midnight through 'sqlplus.exe @purge_aux_table'.</p>
Bash completed man and info pages generation (Python)
2011-08-24T03:14:13-07:00Josh Dhttp://code.activestate.com/recipes/users/4179060/http://code.activestate.com/recipes/577854-bash-completed-man-and-info-pages-generation/
<p style="color: grey">
Python
recipe 577854
by <a href="/recipes/users/4179060/">Josh D</a>
(<a href="/recipes/tags/a/">a</a>, <a href="/recipes/tags/all/">all</a>, <a href="/recipes/tags/and/">and</a>, <a href="/recipes/tags/bash/">bash</a>, <a href="/recipes/tags/be/">be</a>, <a href="/recipes/tags/command/">command</a>, <a href="/recipes/tags/completed/">completed</a>, <a href="/recipes/tags/consume/">consume</a>, <a href="/recipes/tags/file/">file</a>, <a href="/recipes/tags/first/">first</a>, <a href="/recipes/tags/generation/">generation</a>, <a href="/recipes/tags/get/">get</a>, <a href="/recipes/tags/in/">in</a>, <a href="/recipes/tags/info/">info</a>, <a href="/recipes/tags/line/">line</a>, <a href="/recipes/tags/man/">man</a>, <a href="/recipes/tags/modify/">modify</a>, <a href="/recipes/tags/must/">must</a>, <a href="/recipes/tags/only/">only</a>, <a href="/recipes/tags/pages/">pages</a>, <a href="/recipes/tags/possibilties/">possibilties</a>, <a href="/recipes/tags/possiblities/">possiblities</a>, <a href="/recipes/tags/py/">py</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/run/">run</a>, <a href="/recipes/tags/script/">script</a>, <a href="/recipes/tags/so/">so</a>, <a href="/recipes/tags/tab/">tab</a>, <a href="/recipes/tags/terminal/">terminal</a>, <a href="/recipes/tags/the/">the</a>, <a href="/recipes/tags/this/">this</a>, <a href="/recipes/tags/to/">to</a>).
Revision 6.
</p>
<p>The script it self is very self explaining - the task is simple.
*NIX only unless with cygwin perhaps?</p>
<p>To start this open a terminal and strike the "Tab" key to get all possibilities (strike y, and strike the space key alot). Select all then Copy and save in "comms.txt"
Modify the file so ONLY the possiblities consume a line; no prompts or extra newlines.
(first line must be a command, the last line must be a command)</p>
<p>Save the file ("~/Documents/bashing/comms.txt" is my path) then run this script in "~/Documents/bashing/".</p>
<p>This generates two (2) files: "bash_help_man.sh", "bash_help_info.sh".</p>
<p>Then it runs these files: "bash bash_help_man.sh", "bash bash_help_info.sh".</p>
<p>This produces 2 files for every command (every line) in "comms.txt".
All manpages are wrote in "mans/", all infopages are wrote in "infos/"</p>
<p>There is now alot of files to read and organize; lets separate these by size.
Directories are under1kb, under2kb, etc.</p>
<p>Once complete do as you wish the files less than 128 kb;
these files are COPIED into there new respective home, I repeat COPIED.</p>
<p>The files 128 kb and higher ARE NOT copied to anywhere!</p>
Run screensaver from Python (Python)
2009-07-03T10:30:58-07:00Jordan Thorntonhttp://code.activestate.com/recipes/users/4170973/http://code.activestate.com/recipes/576828-run-screensaver-from-python/
<p style="color: grey">
Python
recipe 576828
by <a href="/recipes/users/4170973/">Jordan Thornton</a>
(<a href="/recipes/tags/run/">run</a>, <a href="/recipes/tags/saver/">saver</a>, <a href="/recipes/tags/screen/">screen</a>, <a href="/recipes/tags/screensaver/">screensaver</a>, <a href="/recipes/tags/win32/">win32</a>, <a href="/recipes/tags/win32com/">win32com</a>, <a href="/recipes/tags/win32com_client/">win32com_client</a>, <a href="/recipes/tags/windows/">windows</a>).
</p>
<p>Simple script that will allow you to locate and run the set screensaver from python, if available.</p>