Re: popen from inside a thread not working!

From: Jeff Epler (jepler_at_unpythonic.net)
Date: 03/11/04


Date: Thu, 11 Mar 2004 08:34:52 -0600
To: python-list@python.org

Steve,
Must be something in your program or something different between your
environment and mine. There's no reason why the presence of threads
would change whether stdin is a tty.

$ cat steve.py
import os, thread, time

def run_subcommand():
    os.system("tty")

def run_subcommand_in_thread():
    thread.start_new(run_subcommand, ())
    time.sleep(1) # give it plenty of time to complete...

run_subcommand()
run_subcommand_in_thread()
$ python steve.py
/dev/pts/18
/dev/pts/18

Jeff



Relevant Pages

  • Re: Strong AI Thesis (No Chinese room, I promise)
    ... reason then it is determined. ... of the red block and you ask why I might say its "intention" ... Actually I resist the idea that the environment controls ... predisposition towards becoming alcoholics. ...
    (comp.ai.philosophy)
  • Re: Mvbase or D3 on Microsoft Win 2003 SBS
    ... knew that was a reason I don't hang out with any business people! ... Conversion of an existing Pick ... environment to Pick flavour UV is about the smallest "conversion" step ... that's what I/we think about for any migration effort. ...
    (comp.databases.pick)
  • Re: Hulls sentence doesnt seem to refer to Darwinian
    ... other life forms, ... in the face of environmental pressures, some organisms will survive at ... For whatever reason, some organisms will survive at higher rates than ... of that environment, ...
    (talk.origins)
  • Re: McAfee Virusscan: Generic.dx!sux - false positives?
    ... environment and then the malware engages. ... Sandboxes are just more ... there is no reason to move most software out of a sandboxed ...
    (alt.comp.anti-virus)
  • Re: threads
    ... > Tassilo v. Parseval ... >> The actual reason is the fact that Perl threads are interpreter threads, ... The reason is that for thread creation Perl uses a ... > completely unrelated problem in Win* environment) ...
    (comp.lang.perl.misc)