Latest recipes tagged "redirect"http://code.activestate.com/recipes/tags/redirect/new/2012-03-14T15:12:39-07:00ActiveState Code RecipesRPDB (RobotPythonDebugger) -- a smarter way to debug robotframework tests (Python) 2012-03-14T15:12:39-07:00Daniel Cohnhttp://code.activestate.com/recipes/users/4172918/http://code.activestate.com/recipes/578073-rpdb-robotpythondebugger-a-smarter-way-to-debug-ro/ <p style="color: grey"> Python recipe 578073 by <a href="/recipes/users/4172918/">Daniel Cohn</a> (<a href="/recipes/tags/debugging/">debugging</a>, <a href="/recipes/tags/decorator/">decorator</a>, <a href="/recipes/tags/pdb/">pdb</a>, <a href="/recipes/tags/redirect/">redirect</a>, <a href="/recipes/tags/robot/">robot</a>, <a href="/recipes/tags/rpdb/">rpdb</a>, <a href="/recipes/tags/stdin/">stdin</a>, <a href="/recipes/tags/stdout/">stdout</a>). </p> <p>Robotframework (<a href="http://code.google.com/p/robotframework/" rel="nofollow">http://code.google.com/p/robotframework/</a>) is a tool used to run functional tests against a variety of targets. Tests are organized in the form of keyword tsv or html files, which map input parameters to keyword-argument methods in the test suite. Robot includes a fairly advanced logging mechanism, which is cool -- until you try to debug anything. Debugging is made difficult because robot steals stdin and stdout when it is run, which means bye-bye debugging in the terminal. rpdb solves this in a KISS simple way.</p> Context manager for low-level redirection of stdout/stderr (Python) 2012-01-26T02:14:25-08:00Greg Haskinshttp://code.activestate.com/recipes/users/4176881/http://code.activestate.com/recipes/577564-context-manager-for-low-level-redirection-of-stdou/ <p style="color: grey"> Python recipe 577564 by <a href="/recipes/users/4176881/">Greg Haskins</a> (<a href="/recipes/tags/contextmanager/">contextmanager</a>, <a href="/recipes/tags/context_manager/">context_manager</a>, <a href="/recipes/tags/f2py/">f2py</a>, <a href="/recipes/tags/fortran/">fortran</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/redirect/">redirect</a>, <a href="/recipes/tags/stdout/">stdout</a>). Revision 3. </p> <p>This context manager provides a convenient, Pythonic way to temporarily replace the file descriptors of <code>stdout</code> and <code>stderr</code>, redirecting to either <code>os.devnull</code> or files of your choosing. Swapping the C-level file descriptors is required when suppressing output from compiled extension modules, such as those built using F2PY. It functions equally well for pure-Python code. <em>UPDATE:</em> (see below).</p> redirect printf, stdout,stderr (C) 2009-07-02T00:36:46-07:00J Yhttp://code.activestate.com/recipes/users/4170398/http://code.activestate.com/recipes/576825-redirect-printf-stdoutstderr/ <p style="color: grey"> C recipe 576825 by <a href="/recipes/users/4170398/">J Y</a> (<a href="/recipes/tags/printf/">printf</a>, <a href="/recipes/tags/redirect/">redirect</a>). </p> <p>redirect printf, stdout,stderr</p>