On 3/5/07, Tony Cappellini <[EMAIL PROTECTED]> wrote:

Rename your file from .py to .pyw.
This will prevent the DOS window from appearing


It's not the DOS window from the Python script I was talking about  (in my
mail I said "my python
script is launched with pythonw") but the one resulting from the os.systemor
os.popen commands.

The two solutions that Alan gave are perfect for these :)

Message: 6
Date: Mon, 5 Mar 2007 16:51:42 +0100
From: learner404 <[EMAIL PROTECTED]>
Subject: [Tutor] Hiding/Killing a DOS window (from a previous
       os.system call)
To: "Tutor Python" <tutor@python.org>
Message-ID:
       <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="iso-8859-1"

Hello,

I'm launching an external app through an os.system() or os.popen() but I
don't want the resulting DOS window to hang-on there forever (my python
script is launched with pythonw):
I use a sys.exit() to kill the script who launched the external
app.Thepython script is killed, the app is launched, but the resulting
DOS window
is still there (I have the same result if I use the DOS tskill or taskkill
command to kill the script with his PID).

How could I hide/kill the resulting DOS window  from an os.sytem /
os.popenwith Python ?

Also is there a way to launch an external app. but without os.system and
os.popen to wait there but immediately continue to the next python line
(to
avoid this I'm using a thread for now).

As an example I'm using this so far.
If I use pythonw to launch the script, notepad is launched, the script is
killed but the DOS window stay there.

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to