Hello,
I'm developping an application with python, pyGTK and GTK+.
I've performed many tests by using methods as Popen, popen2,
os.system ... to communicate with Unix (HPUX),
The last attempt is this code written in a thread :
fin,fout = popen2.popen2('ps -def')
line = fin.readline()
while 1 :
if not line : break
print "line=",line
line = fin.readline()
fin.close()
In that case, lines are printed only when I exit my application.
Usually the behavior is not as expected and I cannot understand why. I
am wondering that it could be a constraint from the use of GTK
(mainloop() existence ???).
Is somebody aware about conflict between GTK use and unix mechanism.
Thanks for you help 2 1798
Hi,
how do you start the python app? Goes stdout
to a terminal or a pipe?
"python script.py"
and "python script.py | cat" behave different.
Maybe "sys.stdout.flush()" helps you.
BTW, I switched from threads to idle_add for pygtk
applications.
awalter1 wrote:
Hello,
I'm developping an application with python, pyGTK and GTK+.
I've performed many tests by using methods as Popen, popen2,
os.system ... to communicate with Unix (HPUX),
The last attempt is this code written in a thread :
fin,fout = popen2.popen2('ps -def')
line = fin.readline()
while 1 :
if not line : break
print "line=",line
line = fin.readline()
fin.close()
In that case, lines are printed only when I exit my application.
Usually the behavior is not as expected and I cannot understand why. I
am wondering that it could be a constraint from the use of GTK
(mainloop() existence ???).
Is somebody aware about conflict between GTK use and unix mechanism.
Thanks for you help
--
Thomas Güttler, http://www.thomas-guettler.de/ http://www.tbz-pariv.de/
E-Mail: guettli (*) thomas-guettler + de
Spam Catcher: ni**************@thomas-guettler.de
HI,
I launch my application by 'python script.py'
I've already add a sys.stdout.flush with no effect.
if the idle_add is an alternative to thread, where to get details
about its use (no reference in http://www.pygtk.org/docs/pygtk/
index.html, but very brief information in GTK+ documentation)
In my case how to implement the system call 'ps -def' through idle_add
Thanks
On 30 jan, 16:44, Thomas Guettler <guettli.use...@thomas-guettler.de>
wrote:
Hi,
how do you start the python app? Goes stdout
to a terminal or a pipe?
"python script.py"
and "python script.py | cat" behave different.
Maybe "sys.stdout.flush()" helps you.
BTW, I switched from threads to idle_add for pygtk
applications.
awalter1 wrote:
Hello,
I'm developping an application with python, pyGTK and GTK+.
I've performed many tests by using methods as Popen, popen2,
os.system ... to communicate with Unix (HPUX),
The last attempt is this code written in a thread :
fin,fout = popen2.popen2('ps -def')
line = fin.readline()
while 1 :
if not line : break
print "line=",line
line = fin.readline()
fin.close()
In that case, lines are printed only when I exit my application.
Usually the behavior is not as expected and I cannot understand why. I
am wondering that it could be a constraint from the use of GTK
(mainloop() existence ???).
Is somebody aware about conflict between GTK use and unix mechanism.
Thanks for you help
--
Thomas Güttler,http://www.thomas-guettler.de/http://www.tbz-pariv.de/
E-Mail: guettli (*) thomas-guettler + de
Spam Catcher: niemand.leerm...@thomas-guettler.de- Masquer le texte des messages précédents -
- Afficher le texte des messages précédents -
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Anthony Baxter |
last post by:
On behalf of the Python development team and the Python community, I'm
happy to announce the release of Python 2.3.1 (final).
Python 2.3.1 is a pure bug fix release of Python 2.3, released in...
|
by: Thomas Schmid |
last post by:
Hi there,
I wrote a tcp server which listens on a port. When he gets a new
connection, he starts a new thread like this:
thread.start_new_thread(self.ConnectionHandler, (conn,))
where conn is...
|
by: Gardner Pomper |
last post by:
Hi,
I am pretty new to python, so be gentle :)
I have a python script that spawns a number of threads (configurable) on a
12 processor AIX RISC-6000 machine. It works fine, so long as I am...
|
by: Fazan |
last post by:
I'm using Tim Golden's WMI implementation
(http://tgolden.sc.sabren.com/python/wmi.html) version 0.6 along with
pywin32 build 202. I'm able to successfully query WMI in the main
thread but not in...
|
by: Jacek Pop³awski |
last post by:
Hello.
I am going to write python script which will read python command from
socket, run it and return some values back to socket.
My problem is, that I need some timeout. I need to say for...
| |
by: Hans |
last post by:
Hi all,
Is there a way that the program that created and started a thread also stops
it.
(My usage is a time-out).
E.g.
thread = threading.Thread(target=Loop.testLoop)
thread.start() ...
|
by: cgwalters |
last post by:
Hi,
I've recently been working on an application which does quite a bit
of searching through large data structures and string matching, and I
was thinking that it would help to put some of this...
|
by: Jonathan Shan |
last post by:
Hello,
I am trying to call a function every 5 seconds. My understanding of
time.sleep() is during the sleep time everything "stops". However, in
my application, there are background processes...
|
by: JamesHoward |
last post by:
Are there any good thread profilers available that can profile a
thread as it is running instead of after execution is completed?
I would like to find a python class which looks at a currently...
|
by: Roger Heathcote |
last post by:
sjdevnull@yahoo.com wrote:
<snip>
Fair point, but for sub processes that need to be in close contact with
the original app, or very small functions that you'd like 100s or 1000s
of it seems...
|
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...
| |
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...
|
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,...
|
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...
|
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: 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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |