Re: stdout of child process as an input of another thread in Python?

2015-05-29 Thread dieter
Kevin Peterson writes: > I want to use the stdout of child process as an input of another thread, but > some how I am not able to read the stdout. Using Popen I have created a > child process and stdout of it I have redirected to PIPE (because I don't > want that to be printed on with my main

Re: stdout in subprocess

2010-10-27 Thread D'Arcy J.M. Cain
On Wed, 27 Oct 2010 16:24:29 -0400 Not To Miss wrote: > I have a question on subprocess.Popen, as shown comparably below. When I ran > 1.py, it prints "0". I don't understand how the file is empty. Isn't it > flushed when the file object "out" is closed? On the other hand, running > 2.py prints co

Re: stdout of external program.

2010-07-30 Thread Jean-Michel Pichavant
Paul Lemelle wrote: HELP! :) I am trying to output the following program's output to either a file or variable, how can this be done? # Writing the output to a standard argv argument #1/usr/bin/python import sys for arg in sys.argv: print arg #END Thanks, Paul Hi Paul, after reading

Re: stdout custom

2008-03-19 Thread castironpi
> >> > Can I allocate a second console window, so I can place certain output > >> > to that directly, and leave the original streams alone?  I tried > >> Have you tried using the creationflags argument to subprocess.Popen? > >> Specially the CREATE_NEW_CONSOLE flag. See the Microsoft documentation

Re: stdout custom

2008-03-18 Thread Gabriel Genellina
En Tue, 18 Mar 2008 07:09:08 -0300, <[EMAIL PROTECTED]> escribió: > On Mar 17, 8:16 pm, Gabriel Genellina <[EMAIL PROTECTED]> wrote: >> On 17 mar, 19:43, [EMAIL PROTECTED] wrote: >> >> > Can I allocate a second console window, so I can place certain output >> > to that directly, and leave the orig

Re: stdout custom

2008-03-18 Thread castironpi
> > >>> Can I allocate a second console window, so I can place certain output > > >>> to that directly, and leave the original streams alone?   > > > I've rather lost track of what you're trying to do, but I would > > second Gabriel's suggestion of the standard Windows method of > > debug output: u

Re: stdout custom

2008-03-18 Thread castironpi
On Mar 18, 8:51 am, Tim Golden <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > >>> Can I allocate a second console window, so I can place certain output > >>> to that directly, and leave the original streams alone?   > > I've rather lost track of what you're trying to do, but I would > seco

Re: stdout custom

2008-03-18 Thread Tim Golden
[EMAIL PROTECTED] wrote: >>> Can I allocate a second console window, so I can place certain output >>> to that directly, and leave the original streams alone? I've rather lost track of what you're trying to do, but I would second Gabriel's suggestion of the standard Windows method of debug outpu

Re: stdout custom

2008-03-18 Thread castironpi
On Mar 17, 8:16 pm, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > On 17 mar, 19:43, [EMAIL PROTECTED] wrote: > > > Can I allocate a second console window, so I can place certain output > > to that directly, and leave the original streams alone?  I tried some > > things in subprocess (Py 3a3 /WinXP

Re: stdout custom

2008-03-17 Thread Gabriel Genellina
On 17 mar, 19:43, [EMAIL PROTECTED] wrote: > Can I allocate a second console window, so I can place certain output > to that directly, and leave the original streams alone?  I tried some > things in subprocess (Py 3a3 /WinXP) but they failed.  I don't know if > it's supposed to be possible though,

Re: stdout custom

2008-03-17 Thread castironpi
On Mar 17, 8:16 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sun, 16 Mar 2008 22:27:28 -0200, <[EMAIL PROTECTED]> escribió: > > > Specifically, before the prompts.  Where does the prompt write come > > from; why doesn't it honor my settings of sys.stdout and sys.stderr? > > The interacti

Re: stdout custom

2008-03-17 Thread Gabriel Genellina
En Sun, 16 Mar 2008 22:27:28 -0200, <[EMAIL PROTECTED]> escribió: > Specifically, before the prompts. Where does the prompt write come > from; why doesn't it honor my settings of sys.stdout and sys.stderr? The interactive interpreter uses directly the C predefined streams stdout and stderr. -

Re: stdout and embedding into Windows apps

2007-09-26 Thread Thomas Schreiner
Hi, > I'm extending a windows application (C++) by embedding Python calls. > It seems to be a known problem that windows applications detach > immediately from the calling console, so that all output to stdout > (from both C++ and Python) doesn't get shown anywhere. > > A workaround seems to be

Re: stdout/err and C extentions

2007-06-12 Thread hg
Robert Bauck Hamar wrote: > hg wrote: > >> Robert Bauck Hamar wrote: >> >>> hg wrote: >>> Hi, I have the following * C extention - redir.c #include "Python.h" PyObject * test_redir_test(PyObject *self) { fprintf(

Re: stdout/err and C extentions

2007-06-12 Thread Robert Bauck Hamar
hg wrote: > Robert Bauck Hamar wrote: > >> hg wrote: >> >>> Hi, >>> >>> I have the following >>> >>> * C extention - redir.c >>> >>> >>> #include "Python.h" >>> >>> PyObject * test_redir_test(PyObject *self) { >>> fprintf(stdout, "Hello from an extention!\n"); >>> P

Re: stdout/err and C extentions

2007-06-12 Thread hg
Robert Bauck Hamar wrote: > hg wrote: > >> Hi, >> >> I have the following >> >> * C extention - redir.c >> >> >> #include "Python.h" >> >> PyObject * test_redir_test(PyObject *self) { >> fprintf(stdout, "Hello from an extention!\n"); >> Py_INCREF(Py_None); >> retur

Re: stdout/err and C extentions

2007-06-12 Thread Robert Bauck Hamar
hg wrote: > Hi, > > I have the following > > * C extention - redir.c > > > #include "Python.h" > > PyObject * test_redir_test(PyObject *self) { > fprintf(stdout, "Hello from an extention!\n"); > Py_INCREF(Py_None); > return Py_None; > } > [...] > **

Re: stdout and threads

2007-05-29 Thread kyosohma
On May 28, 4:54 am, "Troels Thomsen" wrote: > Hello All > > I have trouble printing to stdout from a thread and main program. > > Not only will it look strange when they try to print at the same time, that > is ok, but i think i see lock-ups. (strange exceptions in Tkinker etc) Or is > it an issue

Re: Stdout

2007-04-14 Thread hlubenow
[EMAIL PROTECTED] wrote: > Dear Users, > > I am trying to recover through the python function > popen3 the stdout,in,err of a launched process. > > I would like also to recover the stdout which you can > get only through the command: command1 >& filename > > Do you know how I can access to th

Re: Stdout

2007-04-14 Thread Dustan
On Apr 14, 2:49 am, [EMAIL PROTECTED] wrote: > Dear Users, > > I am trying to recover through the python function > popen3 the stdout,in,err of a launched process. > > I would like also to recover the stdout which you can > get only through the command: command1 >& filename > > Do you know how I

Re: stdout not flushed before os.execvp()

2006-10-18 Thread Fulvio
On Wednesday 18 October 2006 00:25, Fredrik Lundh wrote: > |feature. the "exec" system call operates on a lower level than the > |stdio buffering system. I did in this manner: for exe in ('imap4', 'pop3'): if exe in cfgfil[optsrv + '.protocol']: exe = exe[:4]; exe = 'cal

Re: stdout not flushed before os.execvp()

2006-10-17 Thread [EMAIL PROTECTED]
If you wanted to make sure stdio was flushed you could always do... sys.stdout.write("Message\n") sys.stdout.flush() Thomas Guettler wrote: > Hi, > > I noticed, that sys.stout does not get flushed before the process is > replaced. The last print statements (before execvp()) disappear. > > It only

Re: stdout not flushed before os.execvp()

2006-10-17 Thread Fredrik Lundh
Thomas Guettler wrote: > Is this a bug or feature? feature. the "exec" system call operates on a lower level than the stdio buffering system. -- http://mail.python.org/mailman/listinfo/python-list

Re: stdout/stderr for only one thread in a multithreaded python app

2006-07-14 Thread Antoon Pardon
On 2006-07-13, notanotheridiot <[EMAIL PROTECTED]> wrote: > Hi- > > I'm trying to exec some arbitrary code in one thread of an application > and read anything it prints to stdout or stderr in another thread. My > question is how? > > I've tried changing sys.stdout, but that changes stdout for the w

Re: stdout and stderr showing output only after script is done

2005-05-29 Thread MKoool
sorry i meant i installed python version 2.4.1, thanks MKoool wrote: > I just installed python 2.4 for windows. I was using the cygwin > version previously, but wanted to use the official python 2.4 release > to install a module that reads off some registry entries. > > After installing, I did wh

Re: stdout and stderr showing output only after script is done

2005-05-29 Thread MKoool
sorry, i'm an idoit who just found that i should use the -u option, my bad -- http://mail.python.org/mailman/listinfo/python-list