Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion using subprocess.Popen does not suppress terminal window on Windows
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
janis.judvai...@gmail.com  
View profile  
 More options Sep 12 2012, 11:26 am
Newsgroups: comp.lang.python
From: janis.judvai...@gmail.com
Date: Wed, 12 Sep 2012 08:26:34 -0700 (PDT)
Local: Wed, Sep 12 2012 11:26 am
Subject: Re: using subprocess.Popen does not suppress terminal window on Windows
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.

On Friday, June 18, 2010 7:23:19 PM UTC+3, Steven wrote:
> I am calling a ruby program from a python gui and using
> subprocess.Popen in Windows XP using python 2.6.  Unfortunately,
> whenever the ruby program is called a blank command window appears on
> screen, annoying my users.  Is there a way to suppress this behaviour?

> Below is a minimal program that demonstrates the problem.  The problem
> does not manifest if the python program is launched via the command
> line.  To duplicate launch from Windows Explorer by double-clicking on
> the python file.

> --- call_double.pyw ---
> from subprocess import *
> import time

> time.sleep(3) # to show that command window is result of call to Popen
> p = Popen(['ruby.exe', 'double.rb'], stdin=PIPE, stdout=PIPE,
> stderr=PIPE)
> results = open('results.txt', 'w')
> for n in range(10):
>     p.stdin.write("%d\n" % n)
>     result = p.stdout.readline().strip()
>     results.write('double(%s) => %2s\n' % (n, result))
> results.close()

> --- end of call_double.pyw ---

> --- double.rb ---
> while true
>     puts $stdin.gets().strip!.to_i * 2
>     STDOUT.flush
> end
> --- end of double.rb ---

> thanks for any help,
> Steven Rumbalski

I

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.