Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: 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; '"""': 0.05; 'subject:skip:s 10': 0.05; 'sufficient': 0.05; 'url:msdn': 0.07; 'subject:Windows': 0.09; 'python': 0.09; '16-bit': 0.09; 'command.com': 0.09; 'indicates': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'sep': 0.09; 'stdout': 0.09; 'subject:using': 0.09; 'subject:not': 0.11; '"windows': 0.16; 'googling': 0.16; 'pipes': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'stderr.': 0.16; 'subprocess': 0.16; 'url:85)': 0.16; 'url:py': 0.16; 'uses,': 0.16; 'processor': 0.17; "shouldn't": 0.17; 'specify': 0.17; 'thu,': 0.17; '(in': 0.18; 'creates': 0.18; 'appears': 0.18; 'windows': 0.19; '(not': 0.20; 'define': 0.20; 'pipe': 0.22; 'chapter': 0.23; 'command': 0.24; 'script': 0.24; 'looks': 0.26; 'library.': 0.27; "doesn't": 0.28; 'header:X-Complaints-To:1': 0.28; 'run': 0.28; 'identifies': 0.29; 'perl': 0.29; 'prints': 0.29; 'starts': 0.29; 'url:code': 0.29; "i'm": 0.29; 'maybe': 0.29; 'url:source': 0.30; 'function': 0.30; 'point': 0.31; 'system,': 0.32; 'running': 0.32; 'could': 0.32; 'function.': 0.33; 'url:home': 0.33; 'anyone': 0.33; 'to:addr:python-list': 0.33; 'entry': 0.33; 'or,': 0.34; 'process,': 0.35; 'open': 0.35; 'similar': 0.35; 'there': 0.35; 'received:org': 0.36; 'but': 0.36; 'url:library': 0.36; 'charset :us-ascii': 0.36; 'operating': 0.36; 'itself': 0.37; 'does': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'to:addr:python.org': 0.39; 'url:microsoft': 0.39; 'application': 0.40; 'header:Received:5': 0.40; 'your': 0.60; 'url:aspx': 0.60; 'chance': 0.61; 'here:': 0.62; 'url:p': 0.63; 'email addr:gmail.com': 0.63; 'show': 0.63; 'url:en-us': 0.65; 'url:%1': 0.68; 'believe,': 0.84; 'processor.': 0.84; 'spawned': 0.84; 'dennis': 0.91; 'graphical': 0.91; 'examine': 0.95 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: using subprocess.Popen does not suppress terminal window on Windows Date: Thu, 13 Sep 2012 13:58:04 -0400 Organization: > Bestiaria Support Staff < References: <9dc66012-988e-4581-aaab-169dbadbbf93@35g2000vbj.googlegroups.com> <86dbbda6-6cac-4a01-b575-85ab24421221@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-76-253-102-123.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 3.3/32.846 X-No-Archive: YES X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 52 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1347559091 news.xs4all.nl 6971 [2001:888:2000:d::a6]:58924 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:29058 On Thu, 13 Sep 2012 05:33:25 -0700 (PDT), janis.judvaitis@gmail.com declaimed the following in gmane.comp.python.general: > It looks like normal terminal to me, could You define normal? > > Looks like it appears only when target script prints something, but it shouldn't cus I'm using pipes on stdout and stderr. > > If anyone is interested I'm using function doPopen from here: http://code.google.com/p/mansos/source/browse/trunk/tools/IDE/src/helperFunctions.py What does E:\UserData\Wulfraed\My Documents>echo %comspec% C:\WINDOWS\system32\cmd.exe show for your system (not that I'm expecting much difference -- as long as it isn't the 16-bit command.com ) Is there any chance your spawned programs are opening/reading STDIN? That would be sufficient to cause Windows to open a console window. You may need to specify a pipe for STDIN. You may also want to examine (in Python 2.7) chapter 17.1.3 "Windows Popen Helpers" OR, maybe http://msdn.microsoft.com/en-us/library/windows/desktop/ms682528%28v=vs.85%29.aspx """ The system creates a new console when it starts a console process, a character-mode process whose entry point is the main function. For example, the system creates a new console when it starts the command processor. When the command processor starts a new console process, the user can specify whether the system creates a new console for the new process or whether it inherits the command processor's console. """ Note that the console creation is a function of the Windows operating system, and not of the Python subprocess library. Also, if you main process is running under pythonw (explicitly, or via a .pyw extension) your main process itself does not have a console to inherit (pythonw uses, I believe, the WinMain entry point which identifies a graphical interface). Some Googling indicates that ActiveState's Perl includes a wperl.exe which behaves similar to pythonw.exe -- run as a graphical application, not a console application. However -- I don't know if you can thereby use pipes for communication (graphical application doesn't have stdin/stdout)... -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/