Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #29005

Re: using subprocess.Popen does not suppress terminal window on Windows

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <d@davea.name>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'explicitly': 0.04; 'subject:skip:s 10': 0.05; 'executable': 0.07; 'subject:Windows': 0.09; 'python': 0.09; 'created,': 0.09; 'determines': 0.09; 'extension,': 0.09; 'script,': 0.09; 'solution,': 0.09; 'subject:using': 0.09; 'thread,': 0.09; 'cc:addr:python-list': 0.10; 'subject:not': 0.11; 'file,': 0.15; '(eg.': 0.16; 'called,': 0.16; 'exe': 0.16; 'executables': 0.16; 'line)': 0.16; 'naming': 0.16; 'non-python': 0.16; 'supress': 0.16; 'time).': 0.16; 'wrote:': 0.17; 'shell': 0.18; 'windows': 0.19; 'trying': 0.21; 'latter': 0.22; 'help.': 0.22; 'cc:2**0': 0.23; "haven't": 0.23; 'cc:no real name:2**0': 0.24; 'command': 0.24; 'script': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header :User-Agent:1': 0.26; 'am,': 0.27; 'run': 0.28; '"no': 0.29; 'parent': 0.29; 'question:': 0.29; "i'm": 0.29; 'normally': 0.30; 'version,': 0.30; 'launch': 0.32; 'getting': 0.33; 'problem': 0.33; 'know.': 0.33; 'hi,': 0.33; "can't": 0.34; 'screen': 0.34; 'clear': 0.35; 'problem,': 0.35; 'so,': 0.35; 'received:192.168.0': 0.35; 'there': 0.35; 'but': 0.36; 'execute': 0.37; 'one,': 0.37; 'two': 0.37; 'subject:: ': 0.38; 'received:192': 0.39; 'received:192.168': 0.40; 'your': 0.60; 'launching': 0.62; 'email addr:gmail.com': 0.63; 'header:Reply- To:1': 0.68; 'received:74.208': 0.71; 'reply-to:no real name:2**0': 0.72; 'console,': 0.84; 'experiencing': 0.84; 'flag.': 0.84; 'received:74.208.4.194': 0.84
Date Wed, 12 Sep 2012 19:49:31 -0400
From Dave Angel <d@davea.name>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0
MIME-Version 1.0
To janis.judvaitis@gmail.com
Subject Re: using subprocess.Popen does not suppress terminal window on Windows
References <9dc66012-988e-4581-aaab-169dbadbbf93@35g2000vbj.googlegroups.com> <b0b48937-801b-413e-843a-b0e557fbb7de@googlegroups.com>
In-Reply-To <b0b48937-801b-413e-843a-b0e557fbb7de@googlegroups.com>
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
X-Provags-ID V02:K0:/krZ1sKHsVN3BzM7er9ighgJTyt3SY80rHA9pOBzx+F NkQxRwGLZDh0X3Iv2LI4H/uOPoXU7BGdaRRzBoABeVxoOUHbfc R0QKSUWUyyIA2rxzxfnb1JmU4LrhZgh3Tk19fay6Bn26DOtIR8 Bgk3QjVVPEsuIJQqr4lFvAsgc475IXD2GC9KGE/3AIozipFcFq 0n/clpm5wJWyhGiYCgnUc+j56Ozw6vgUO5FyPXs/90RQ7nv8Qz AuKquAWQKrHNNZBbN+oa/xlRcjlvIY31gvAjUNIKUPr4VpFvL0 0sJUAnIDC40rt4f+mCD51Z2AsIOb2kNzaEe7Z01ID7SyfSVLQ= =
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
Reply-To d@davea.name
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.584.1347493774.27098.python-list@python.org> (permalink)
Lines 27
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1347493774 news.xs4all.nl 6989 [2001:888:2000:d::a6]:50509
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:29005

Show key headers only | View raw


On 09/12/2012 11:26 AM, janis.judvaitis@gmail.com wrote:
> Hi, and I'm sorry for using this old thread, but I'm experiencing the same problem, except, that I wan't to execute any shell script or exe without blank terminal window. 
> Is there any way in python to supress blank console screen while script is executing? Multiplatform solution would be nice.
> With best regards, Jānis.
>

it's not clear from your question:  Are you launching non-Python
programs from a python one, using Popen?  If so, I can't help.  It's the
launchee that determines if a console is created, as best as I know. 
However, if you're trying to launch a python program without its getting
a console, then read on.

No need for a multiplatform solution, since the problem is a Windows
one.  Windows will create a console for a new process unless the parent
console is still available (eg. you run it from command line) or unless
the executable is marked with the "no console" flag.  (I don't recall
what that's actually called, I haven't used Windows in a long time).

Anyway, in the Windows version, there are two executables  python.exe
and pythonw.exe.  You want the latter one, either by explicitly naming
it in your launcher (batch file, script, whatever), or by using the .pyw
extension, which is normally associated with the pythonw.exe program.

-- 

DaveA

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: using subprocess.Popen does not suppress terminal window on Windows janis.judvaitis@gmail.com - 2012-09-12 08:26 -0700
  Re: using subprocess.Popen does not suppress terminal window on Windows Dave Angel <d@davea.name> - 2012-09-12 19:49 -0400

csiph-web