¡@

Home 

python Programming Glossary: pipe

Python subprocess readlines() hangs

http://stackoverflow.com/questions/12419198/python-subprocess-readlines-hangs

use pty due to reasons outlined in Q Why not just use a pipe popen all other answers so far ignore your NOTE I don't want..

Showing the stack trace from a running Python application

http://stackoverflow.com/questions/132058/showing-the-stack-trace-from-a-running-python-application

except it communicates with the running process through a pipe to allow for debugging backgrounded processes etc . Its a bit..

Force another program's standard output to be unbuffered using Python

http://stackoverflow.com/questions/1544050/force-another-programs-standard-output-to-be-unbuffered-using-python

an external application on Linux passing in input via a pipe to the external applications stdin and reading output via a.. the external applications stdin and reading output via a pipe from the external applications stdout. The problem is that writes.. applications stdout. The problem is that writes to pipes are buffered by block and not by line and therefore delays..

catching stdout in realtime from subprocess

http://stackoverflow.com/questions/1606795/catching-stdout-in-realtime-from-subprocess

its output when it detects that it is connected to a pipe instead of a terminal. It is in fact the default when connected.. a terminal. It is in fact the default when connected to a pipe programs must explicity flush stdout for realtime results otherwise..

Python - How do I pass a string into subprocess.Popen (using the stdin argument)?

http://stackoverflow.com/questions/163542/python-how-do-i-pass-a-string-into-subprocess-popen-using-the-stdin-argument

stdout PIPE and or stderr PIPE too. Replacing os.popen pipe os.popen cmd 'w' bufsize # pipe Popen cmd shell True bufsize.. too. Replacing os.popen pipe os.popen cmd 'w' bufsize # pipe Popen cmd shell True bufsize bufsize stdin PIPE .stdin Warning.. stderr.read to avoid deadlocks due to any of the other OS pipe buffers filling up and blocking the child process. So your example..

How to capture Python interpreter's and/or CMD.EXE's output from a Python script?

http://stackoverflow.com/questions/24931/how-to-capture-python-interpreters-and-or-cmd-exes-output-from-a-python-script

to the console but redirection is possible using the pipe notation python script_a.py python script_b.py This ties the.. For communication the process.stdin and process.stdout pipes are considered standard file objects . For use with pipes reading.. pipes are considered standard file objects . For use with pipes reading from standard input as lassevk suggested you'd do something..

How to stream an HttpResponse with Django

http://stackoverflow.com/questions/2922874/how-to-stream-an-httpresponse-with-django

as it streams you can push a bunch of whitespace down the pipe to force its buffers to fill. Example follows from django.views.decorators.http..

Multiprocessing: using Pool.map on a function defined in a class

http://stackoverflow.com/questions/3288595/multiprocessing-using-pool-map-on-a-function-defined-in-a-class

Pipe from itertools import izip def spawn f def fun pipe x pipe.send f x pipe.close return fun def parmap f X pipe Pipe.. Pipe from itertools import izip def spawn f def fun pipe x pipe.send f x pipe.close return fun def parmap f X pipe Pipe for.. import izip def spawn f def fun pipe x pipe.send f x pipe.close return fun def parmap f X pipe Pipe for x in X proc Process..

UnicodeDecodeError when redirecting to file

http://stackoverflow.com/questions/4545661/unicodedecodeerror-when-redirecting-to-file

8' for modern terminals . However when you redirect or pipe the output of your program then it is generally not possible..

Python: MySQLdb and “Library not loaded: libmysqlclient.16.dylib”

http://stackoverflow.com/questions/4559699/python-mysqldb-and-library-not-loaded-libmysqlclient-16-dylib

DNDEBUG g fwrapv Os Wall Wstrict prototypes DENABLE_DTRACE pipe Dversion_info 1 2 3 'final' 0 D__version__ 1.2.3 I usr local..

Setting the correct encoding when piping stdout in python

http://stackoverflow.com/questions/492483/setting-the-correct-encoding-when-piping-stdout-in-python

xa0' in position 0 ordinal not in range 128 when used in a pipe sequence. What is the best way to make this work when piping..

How should I log while using multiprocessing in Python?

http://stackoverflow.com/questions/641420/how-should-i-log-while-using-multiprocessing-in-python

its log goes to a different file descriptor to disk or to pipe. Ideally all log entries should be timestamped. Your controller.. at the end of the run sorting by timestamp or if using pipes recommended approach coalesce log entries on the fly from all.. approach coalesce log entries on the fly from all pipes into a central log e.g. periodically select from the pipes'..

How do I get 'real-time' information back from a subprocess.Popen in python (2.5)

http://stackoverflow.com/questions/874815/how-do-i-get-real-time-information-back-from-a-subprocess-popen-in-python-2-5

import os from subprocess import Popen PIPE def worker pipe while True line pipe.readline if line '' break else print line.. import Popen PIPE def worker pipe while True line pipe.readline if line '' break else print line proc Popen python..

Python subprocess readlines() hangs

http://stackoverflow.com/questions/12419198/python-subprocess-readlines-hangs

everything at once main.py from subprocess import Popen PIPE STDOUT import pty import os file_path ' Users luciano Desktop.. in non interactive mode from subprocess import Popen PIPE STDOUT proc Popen 'stdbuf' ' oL' 'ruby' 'ruby_sleep.rb' bufsize.. 'stdbuf' ' oL' 'ruby' 'ruby_sleep.rb' bufsize 1 stdout PIPE stderr STDOUT close_fds True for line in iter proc.stdout.readline..

Python - How do I pass a string into subprocess.Popen (using the stdin argument)?

http://stackoverflow.com/questions/163542/python-how-do-i-pass-a-string-into-subprocess-popen-using-the-stdin-argument

StringIO subprocess.Popen 'grep' 'f' stdout subprocess.PIPE stdin StringIO 'one ntwo nthree nfour nfive nsix n' .communicate.. ™s stdin you need to create the Popen object with stdin PIPE. Similarly to get anything other than None in the result tuple.. than None in the result tuple you need to give stdout PIPE and or stderr PIPE too. Replacing os.popen pipe os.popen cmd..

Non-blocking read on a subprocess.PIPE in python

http://stackoverflow.com/questions/375427/non-blocking-read-on-a-subprocess-pipe-in-python

blocking read on a subprocess.PIPE in python I'm using the subprocess module to start a subprocess.. p subprocess.Popen 'myprogram.exe' stdout subprocess.PIPE str p.stdout.readline python io subprocess nonblocking share.. to use Queue.get_nowait import sys from subprocess import PIPE Popen from threading import Thread try from Queue import Queue..

Running shell command from python and capturing the output

http://stackoverflow.com/questions/4760215/running-shell-command-from-python-and-capturing-the-output

to use communicate . As in output Popen mycmd myarg stdout PIPE .communicate 0 Or import subprocess p subprocess.Popen 'ls'.. subprocess p subprocess.Popen 'ls' ' a' stdout subprocess.PIPE stderr subprocess.PIPE out err p.communicate print out . .... 'ls' ' a' stdout subprocess.PIPE stderr subprocess.PIPE out err p.communicate print out . .. foo share improve this..

Getting realtime output using subprocess

http://stackoverflow.com/questions/803265/getting-realtime-output-using-subprocess

just execute the program using subprocess.Popen use stdout PIPE then read each line as it came in and act on it accordingly... 439 the last line of output from subprocess import Popen PIPE STDOUT p Popen 'svnadmin verify var svn repos config' stdout.. p Popen 'svnadmin verify var svn repos config' stdout PIPE stderr STDOUT shell True for line in p.stdout print line.replace..

How do I get 'real-time' information back from a subprocess.Popen in python (2.5)

http://stackoverflow.com/questions/874815/how-do-i-get-real-time-information-back-from-a-subprocess-popen-in-python-2-5

readline of myprocess.stdout using stdout subprocess.PIPE I don't get any lines with this method either until the process.. __name__ __main__ import os from subprocess import Popen PIPE def worker pipe while True line pipe.readline if line '' break.. line proc Popen python subprocess_test.py shell True stdin PIPE stdout PIPE stderr PIPE stdout_worker ThreadWorker worker proc.stdout..

Wrapping an interactive command line application in a python script

http://stackoverflow.com/questions/1567371/wrapping-an-interactive-command-line-application-in-a-python-script

script that will start a CLI application on the host OS. Pipe anything from stdin to the cli application and then pipe any..

Multiprocessing: using Pool.map on a function defined in a class

http://stackoverflow.com/questions/3288595/multiprocessing-using-pool-map-on-a-function-defined-in-a-class

use of parmap. from multiprocessing import Process Pipe from itertools import izip def spawn f def fun pipe x pipe.send.. x pipe.send f x pipe.close return fun def parmap f X pipe Pipe for x in X proc Process target spawn f args c x for x p c in..

Pipe raw OpenCV images to FFmpeg

http://stackoverflow.com/questions/5825173/pipe-raw-opencv-images-to-ffmpeg

raw OpenCV images to FFmpeg Here's a fairly straightforward..

Broken Pipe error when using pip to install pycrypto on Mac OS X

http://stackoverflow.com/questions/5944332/broken-pipe-error-when-using-pip-to-install-pycrypto-on-mac-os-x

Pipe error when using pip to install pycrypto on Mac OS X I am attempting..

Python multiprocessing - Pipe vs Queue

http://stackoverflow.com/questions/8463008/python-multiprocessing-pipe-vs-queue

multiprocessing Pipe vs Queue What are the fundamental differences between queues.. choose one over the other When is it advantageous to use Pipe When is it advantageous to use Queue python performance queue.. multiprocessing pipe share improve this question A Pipe can only have two endpoints. A Queue can have multiple producers..

What should I do if socket.setdefaulttimeout() is not working?

http://stackoverflow.com/questions/8464391/what-should-i-do-if-socket-setdefaulttimeout-is-not-working

back to your application it might be multiprocessing.Pipe . Here comes the example from multiprocessing import Process.. Here comes the example from multiprocessing import Process Pipe import time def request sleep result Your http request example.. result # send result to pipe parent_pipe child_pipe Pipe # Pipe for retrieving result of func p Process target pmain..