473,474 Members | 1,681 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Tkinter+popen4+windows leads to unwanted window

We have a python+Tkinter program that works properly on
Linux, but when moved to Windows (XP) it behaves in a
strange way. There's a section like this:

(child_out, child_in) = popen2.popen4(cmd)
line = child_out.readline()
while line:
do_something_with(line)
line = child_out.readline()

The program named in the string cmd is a C++
application which writes lines of text to its
standard output.
The function do_something_with() displays the output
in a text window.

When I run this script on Windows XP with a recent
version of Active State python, nothing appears in
the text window. Instead a new command tool window
opens, and all the text appears there. When the
program (cmd) terminates, the command tool remains,
ready to accept commands. The Tkinter window locks
up, with its menu bar blanked out. The python
process burns 100% of the cpu time.

Apparently the child_out "file" returned by popen4
isn't really passing its data to the python script.
It seems to be going directly to a command tool,
and I would guess that readline() is in an infinite
loop.

Is there some way to deal with this?

--
* Patrick L. Nolan *
* W. W. Hansen Experimental Physics Laboratory (HEPL) *
* Stanford University *
Jul 18 '05 #1
0 1078

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Patrick L. Nolan | last post by:
We have an application that works on Linux. It has to be ported to Windows XP, and there's one bug that's driving me crazy. There's a number-crunching program written in C++. It is invoked by a...
2
by: Patrick L. Nolan | last post by:
I'm going nuts trying to port an application from Linux to Windows. We have a python/Tkinter script which runs a C++ application. It starts it with popen4 and communicates through the two pipes....
4
by: Jeffrey Barish | last post by:
I'm confused about how to use the update_idletasks method. In my program, I have a handler for a button in which execution will linger. During that time, I would like for the GUI to continue to...
4
by: Yann.K | last post by:
Hello. Using Tkinter, i would create a widget which display a shell command return. This return is long, and i would display a real time display (like with the tail -f commande on Linux) I...
2
by: André | last post by:
Short description: Using a wxPython based app, I would like to take a python script in an editor window, invoke the python interpreter and use another window as stdin/stdout/stderr. Based on...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.