Popular recipes tagged "popen"http://code.activestate.com/recipes/tags/popen/popular/2015-02-28T07:04:31-08:00ActiveState Code RecipesA Basic USe flag EDitor for Gentoo Linux supporting on-the-fly editing (Python)
2015-02-28T07:04:31-08:00Mike 'Fuzzy' Partinhttp://code.activestate.com/recipes/users/4179778/http://code.activestate.com/recipes/579028-a-basic-use-flag-editor-for-gentoo-linux-supportin/
<p style="color: grey">
Python
recipe 579028
by <a href="/recipes/users/4179778/">Mike 'Fuzzy' Partin</a>
(<a href="/recipes/tags/parsing/">parsing</a>, <a href="/recipes/tags/popen/">popen</a>, <a href="/recipes/tags/subprocess/">subprocess</a>, <a href="/recipes/tags/user_input/">user_input</a>).
</p>
<p>This allows for on-the-fly editing. Simply drop abused.py into your path, and ensure that -a is not set in EMERGE_DEFAULT_OPTS in /etc/portage/make.conf. Then whenver you are installing new packages, use abused in place of emerge (eg: abused multitail) you will be presented with a list of use flags that are used in this action, and a prompt for editing any of them, simply hit enter with no changes to fire off the build.</p>
rdd (mostly broken but shows how to do a few things in ruby) (Ruby)
2014-07-12T16:58:06-07:00Mike 'Fuzzy' Partinhttp://code.activestate.com/recipes/users/4179778/http://code.activestate.com/recipes/578034-rdd-mostly-broken-but-shows-how-to-do-a-few-things/
<p style="color: grey">
Ruby
recipe 578034
by <a href="/recipes/users/4179778/">Mike 'Fuzzy' Partin</a>
(<a href="/recipes/tags/dd/">dd</a>, <a href="/recipes/tags/ftp/">ftp</a>, <a href="/recipes/tags/io/">io</a>, <a href="/recipes/tags/net_ftp/">net_ftp</a>, <a href="/recipes/tags/pipe/">pipe</a>, <a href="/recipes/tags/pipelining/">pipelining</a>, <a href="/recipes/tags/popen/">popen</a>, <a href="/recipes/tags/subprocess/">subprocess</a>).
Revision 3.
</p>
<p>Meant to be a slightly more "advanced" dd utility. Supporting FTP/File/STDIN as input streams, and File/STDOUT/PIPE as output targets, and sporting a progress display (very rudimentary atm), add lets you combine network, and file or pipe processing in a single command. But kind of ended up a mess, see the <a href="https://code.activestate.com/recipes/578907-python-awesome-dd/?in=user-4179778">Python version</a> which is pretty clean.</p>
unix subprocess wrapper (Python)
2008-07-29T07:11:17-07:00Pádraig Bradyhttp://code.activestate.com/recipes/users/1890175/http://code.activestate.com/recipes/576387-unix-subprocess-wrapper/
<p style="color: grey">
Python
recipe 576387
by <a href="/recipes/users/1890175/">Pádraig Brady</a>
(<a href="/recipes/tags/group/">group</a>, <a href="/recipes/tags/popen/">popen</a>, <a href="/recipes/tags/subprocess/">subprocess</a>, <a href="/recipes/tags/unix/">unix</a>).
Revision 2.
</p>
<p>I have used this for ages to control child processes (and all their children). Some of the existing subprocess module was based on this, but I find this simpler for my uses at least.</p>
<h4>Example:</h4>
<pre class="prettyprint"><code>import subProcess
process = subProcess.subProcess("your shell command")
process.read() #timeout is optional
handle(process.outdata, process.errdata)
del(process)
</code></pre>