Popular recipes tagged "pipe" but not "map"http://code.activestate.com/recipes/tags/pipe-map/2016-09-22T15:32:17-07:00ActiveState Code RecipesFunctional D plus Python pipeline to generate PDF (Text) 2016-09-22T15:32:17-07:00Vasudev Ramhttp://code.activestate.com/recipes/users/4173351/http://code.activestate.com/recipes/580701-functional-d-plus-python-pipeline-to-generate-pdf/ <p style="color: grey"> Text recipe 580701 by <a href="/recipes/users/4173351/">Vasudev Ram</a> (<a href="/recipes/tags/pdfwriter/">pdfwriter</a>, <a href="/recipes/tags/pdf_generation/">pdf_generation</a>, <a href="/recipes/tags/pipe/">pipe</a>, <a href="/recipes/tags/pipeline/">pipeline</a>, <a href="/recipes/tags/xtopdf/">xtopdf</a>). </p> <p>This recipe is a command pipeline. The first component of the pipeline is a D language program that makes use of simple functional programming and template / generic programming features of D, to transform some input into the desired output. Both input and output are text. The D program writes the output to standard output, which is then read by a Python program that reads that as input via standard input, and converts it to PDF.</p> Python-controlled Unix pipeline to generate PDF (Python) 2016-01-07T18:02:52-08:00Vasudev Ramhttp://code.activestate.com/recipes/users/4173351/http://code.activestate.com/recipes/579146-python-controlled-unix-pipeline-to-generate-pdf/ <p style="color: grey"> Python recipe 579146 by <a href="/recipes/users/4173351/">Vasudev Ram</a> (<a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/pdf/">pdf</a>, <a href="/recipes/tags/pdf_generation/">pdf_generation</a>, <a href="/recipes/tags/pipe/">pipe</a>, <a href="/recipes/tags/pipelining/">pipelining</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/python2/">python2</a>, <a href="/recipes/tags/unix/">unix</a>). </p> <p>This recipe shows how to create a Unix pipeline that generates PDF output, under the control of a Python program. It is tested on Linux. It uses nl, a standard Linux command that adds line numbers to its input, and selpg, a custom Linux command-line utility, that selects only specified pages from its input, together in a pipeline (nl | selpg). The Python program sets up and starts that pipeline running, and then reads input from it and generates PDF output.</p> Threaded communication with subprocess (Python) 2013-03-13T06:06:16-07:00Jan Müllerhttp://code.activestate.com/recipes/users/4183984/http://code.activestate.com/recipes/578488-threaded-communication-with-subprocess/ <p style="color: grey"> Python recipe 578488 by <a href="/recipes/users/4183984/">Jan Müller</a> (<a href="/recipes/tags/async/">async</a>, <a href="/recipes/tags/ipc/">ipc</a>, <a href="/recipes/tags/messaging/">messaging</a>, <a href="/recipes/tags/multithreading/">multithreading</a>, <a href="/recipes/tags/pipe/">pipe</a>, <a href="/recipes/tags/queue/">queue</a>, <a href="/recipes/tags/subprocess/">subprocess</a>). Revision 3. </p> <p>This recipe shows how to domesticate another executable as a service in a subprocess.</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> Pyliner - Script to run arbitrary Python code on the command line (Python) 2011-07-29T13:22:54-07:00Drew Gulinohttp://code.activestate.com/recipes/users/4119417/http://code.activestate.com/recipes/577075-pyliner-script-to-run-arbitrary-python-code-on-the/ <p style="color: grey"> Python recipe 577075 by <a href="/recipes/users/4119417/">Drew Gulino</a> (<a href="/recipes/tags/awk/">awk</a>, <a href="/recipes/tags/oneliner/">oneliner</a>, <a href="/recipes/tags/perl/">perl</a>, <a href="/recipes/tags/pipe/">pipe</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/sed/">sed</a>, <a href="/recipes/tags/sysadmin/">sysadmin</a>). </p> <p>A Python script that runs arbitrary Python scripts in an input loop. This allows one-liner Python scripts similarly to how Perl runs them (-l,-a,-n,-F, BEGIN, END)</p> <p>It provides additional syntax that allows multiline Python scripts to be run on a single line</p> Align text filter (Python) 2010-03-09T07:34:43-08:00Denis Barmenkovhttp://code.activestate.com/recipes/users/57155/http://code.activestate.com/recipes/577093-align-text-filter/ <p style="color: grey"> Python recipe 577093 by <a href="/recipes/users/57155/">Denis Barmenkov</a> (<a href="/recipes/tags/align/">align</a>, <a href="/recipes/tags/pipe/">pipe</a>, <a href="/recipes/tags/text/">text</a>, <a href="/recipes/tags/wrap/">wrap</a>). Revision 4. </p> <p>Python 2.3 module textwrap can justify text in three modes: left/right/center. Sometimes 'align' mode become more useful.</p> Asynchronous pipe communication using asyncore (Python) 2013-10-29T16:48:22-07:00Glenn Eychanerhttp://code.activestate.com/recipes/users/4172294/http://code.activestate.com/recipes/576967-asynchronous-pipe-communication-using-asyncore/ <p style="color: grey"> Python recipe 576967 by <a href="/recipes/users/4172294/">Glenn Eychaner</a> (<a href="/recipes/tags/async/">async</a>, <a href="/recipes/tags/asyncore/">asyncore</a>, <a href="/recipes/tags/i_o/">i_o</a>, <a href="/recipes/tags/pipe/">pipe</a>). Revision 9. </p> <p>Extends file_dispatcher to provide extra functionality for reading from and writing to pipes. Uses the observer pattern (<a href="http://code.activestate.com/recipes/576962/">recipe 576962</a>) to provide notification of new data and closed pipes.</p> Subprocess with async I/O pipes class (Python) 2009-05-17T02:02:04-07:00Mike Kazantsevhttp://code.activestate.com/recipes/users/4170279/http://code.activestate.com/recipes/576759-subprocess-with-async-io-pipes-class/ <p style="color: grey"> Python recipe 576759 by <a href="/recipes/users/4170279/">Mike Kazantsev</a> (<a href="/recipes/tags/asynchronous/">asynchronous</a>, <a href="/recipes/tags/ipc/">ipc</a>, <a href="/recipes/tags/non_blocking_i_o/">non_blocking_i_o</a>, <a href="/recipes/tags/pipe/">pipe</a>, <a href="/recipes/tags/subprocess/">subprocess</a>). Revision 2. </p> <p>Just stumbled upon the need to move data chunks between subprocesses in a non-linear way with some logic in-between, so tee(1) and fifo(7)'s weren't too good option. Inspired by 440554, but rewritten from scratch to remove unnecessary delays due to sleep(3) calls and suboptimal try/sleep-based polling.</p> commanding via a duplex pipe stream. (C) 2009-06-07T01:41:19-07:00J Yhttp://code.activestate.com/recipes/users/4170398/http://code.activestate.com/recipes/576773-commanding-via-a-duplex-pipe-stream/ <p style="color: grey"> C recipe 576773 by <a href="/recipes/users/4170398/">J Y</a> (<a href="/recipes/tags/command/">command</a>, <a href="/recipes/tags/ipc/">ipc</a>, <a href="/recipes/tags/pipe/">pipe</a>). Revision 2. </p> <p>commanding via a duplex pipe stream.</p> CallPipe: Call the methods of an object in a remote process (Python) 2008-09-17T17:33:36-07:00david decotignyhttp://code.activestate.com/recipes/users/4129454/http://code.activestate.com/recipes/576509-callpipe-call-the-methods-of-an-object-in-a-remote/ <p style="color: grey"> Python recipe 576509 by <a href="/recipes/users/4129454/">david decotigny</a> (<a href="/recipes/tags/call/">call</a>, <a href="/recipes/tags/multiprocessing/">multiprocessing</a>, <a href="/recipes/tags/pipe/">pipe</a>, <a href="/recipes/tags/processing/">processing</a>, <a href="/recipes/tags/remote/">remote</a>). Revision 6. </p> <p>I am process A and I own object Obj. Now I decide to fork(): process B is born.</p> <p>How do I do to make process B call the methods of A's object Obj (and not the methods of its own copy of Obj...) ?</p> <p>This is what this module does: you create the "CallPipe" for Obj prior to fork()ing, and then process B can call any method of A's object Obj through it.</p>