473,408 Members | 1,866 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Popen4 -> null lines on Windows

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 Tkinter python script. The script uses the threading
module to separate out the heavy processing. The worker thread
uses popen4 to run the C++ program and capture its standard
output. This output is sent to the master thread through a
queue and displayed by the gui.

As I said, it works on Linux. On XP, every call to readline()
on the program's stdout returns only a zero-length string.
We are confident that the C++ program doesn't behave that
way. We have tried both popen2.popen4 and win32pipe.popen4.

Does this sound familiar to anyone?

--
* Patrick L. Nolan *
* W. W. Hansen Experimental Physics Laboratory (HEPL) *
* Stanford University *
Jul 18 '05 #1
2 1791
"Patrick L. Nolan" <pl*@cosmic.stanford.edu> schrieb im Newsbeitrag
news:bs**********@news.Stanford.EDU...
| 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 Tkinter python script. The script uses the threading
| module to separate out the heavy processing. The worker thread
| uses popen4 to run the C++ program and capture its standard
| output. This output is sent to the master thread through a
| queue and displayed by the gui.
|
| As I said, it works on Linux. On XP, every call to readline()
| on the program's stdout returns only a zero-length string.
| We are confident that the C++ program doesn't behave that
| way. We have tried both popen2.popen4 and win32pipe.popen4.
|
| Does this sound familiar to anyone?

The output doesn't contain any low values by any chance? Does this also
happen when the "mode" flag is set to "b" for binary?

Vincent Wehren
|
| --
| * Patrick L. Nolan *
| * W. W. Hansen Experimental Physics Laboratory (HEPL) *
| * Stanford University *
Jul 18 '05 #2
vincent wehren <vi*****@visualtrans.de> wrote:
"Patrick L. Nolan" <pl*@cosmic.stanford.edu> schrieb im Newsbeitrag
news:bs**********@news.Stanford.EDU...
| 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 Tkinter python script. The script uses the threading
| module to separate out the heavy processing. The worker thread
| uses popen4 to run the C++ program and capture its standard
| output. This output is sent to the master thread through a
| queue and displayed by the gui.
|
| As I said, it works on Linux. On XP, every call to readline()
| on the program's stdout returns only a zero-length string.
| We are confident that the C++ program doesn't behave that
| way. We have tried both popen2.popen4 and win32pipe.popen4.
|
| Does this sound familiar to anyone? The output doesn't contain any low values by any chance? Does this also
happen when the "mode" flag is set to "b" for binary?


It works the same with both "b" and "t".
--
* Patrick L. Nolan *
* W. W. Hansen Experimental Physics Laboratory (HEPL) *
* Stanford University *
Jul 18 '05 #3

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

Similar topics

1
by: Rasmusson, Lars | last post by:
Hi, I have a problem doing I/O in a python thread. I want a thread to execute a command using os.popen, read its input until the end, and then print 'DONE' and terminate. However, the...
0
by: Jim | last post by:
Hi, I'm using popen2.Popen4 and I'm curious what exceptions it could raise for example p = popen2.POpen4( 'command string' ) i'm assuming would only raise OSError exceptions if something went...
0
by: Jim | last post by:
Hi, I noticed with popen2.Popen4 class, sometimes the poll() method will keep returning -1 although the command has finished. However, when a read is done ( ex. p4instance.fromchild.read() )...
6
by: Robin Siebler | last post by:
I have a bunch of command line tests that I need to automate. I've run into too many bugs with the default Win2k command shell, so I need to either purchase 4NT or handle the logic and output...
4
by: billie | last post by:
Hi all. I'm trying to execute system commands and capture the output by using popen4: stdout example: >>>exec_cmd = popen2.popen4("echo hello!") >>>output = exec_cmd.read() hello stderr...
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...
2
by: Grant Edwards | last post by:
I'm having problems calling the Popen4 object wait() method from a thread. The folloing program produces an error on some machines (but seems to work on others) ...
0
by: micklee74 | last post by:
hi i have to execute some SQL statements against a database using a SQL client i want to use the os.popen4 module can someone correct the way i use os.popen4? thanks fin = "select * from...
0
by: hortitude | last post by:
I am trying to run the following script: #!/usr/bin/python import popen2 commandToRun = """scp scp_trial.py user@host:/targetDirectory""" #commandToRun = "ls" print commandToRun
1
by: julian | last post by:
Hi all, I know it's a kind of bizarre question but here I go: I want to execute an script using popen4. This script executes a command in turn using popen4 too. The first one throws a 256 exit...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
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...

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.