473,398 Members | 2,404 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,398 software developers and data experts.

sending signals to child process

I would like to start a child process (like w/ popen3(), or some such)
and then be able to interrupt it by sending it a control-c. How do I
do that in Python? Is there a better way to gracefully halt a child
process? Is there a more cross-platform way to start a child process
(popen() is only on UNIX/Win32)? Thanks.

Sarir
Jul 18 '05 #1
2 2039
Sarir Khamsi wrote:
I would like to start a child process (like w/ popen3(), or some such)
and then be able to interrupt it by sending it a control-c. How do I
do that in Python? Is there a better way to gracefully halt a child
Use os.kill and the signal module.
process? Is there a more cross-platform way to start a child process
(popen() is only on UNIX/Win32)? Thanks.


In python2.4 there is the subprocess module.
--
Regards,

Diez B. Roggisch
Jul 18 '05 #2
"Diez B. Roggisch" <de*********@web.de> writes:
Sarir Khamsi wrote:
I would like to start a child process (like w/ popen3(), or some such)
and then be able to interrupt it by sending it a control-c. How do I
do that in Python? Is there a better way to gracefully halt a child


Use os.kill and the signal module.
process? Is there a more cross-platform way to start a child process
(popen() is only on UNIX/Win32)? Thanks.


In python2.4 there is the subprocess module.


This is what I was looking for...thanks.

Sarir
Jul 18 '05 #3

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

Similar topics

1
by: rs035 | last post by:
good morning, everybody i know, it seems more to be a problem according to unix but i got it while developing software with php: i have 2 different users on a hp-ux machine that execute php...
4
by: Gabriele Bartolini | last post by:
Hi, I am writing an application in C++ on Linux, using threads (this is my first experience with pthreads). The application itself is fine, it is just that I wanted to handle asynchronous...
1
by: bill | last post by:
This is not strictly a C question, but groups such as comp.unix.wizards seem to have died. Does anyone know the appropriate group for this question? I want to signal an upstream process. eg:...
3
by: s99999999s2003 | last post by:
hi i have a program that works very similar to tail -f in Unix It will need a Ctrl-C in order to break out of the program. I wish to run this program using python (either thru os.system() or some...
0
by: Mitko Haralanov | last post by:
Hi everyone, First off, I know that this has been discussed before and I did a search but could not find anything that helped my situation. Here is the problem: I have a Python program that...
1
by: Chad J. Schroeder | last post by:
I've run into an "opportunity" in a Python application using threads and signals. Basically, there is a main process that spawns off a child thread that loops forever. In between iterations, the...
3
by: Daniel Clark | last post by:
I have a Windows command line based application that only shuts down cleanly if it sees "CTRL-C" on the console. I need to automate the running of this application, but still allow the user sitting...
4
by: david | last post by:
hello, I have a client/server application. the server capture picture from webcam and send it to every client connected to it.the network part works good and the capture from webcam too. I...
7
by: gamename | last post by:
Hi, I really like this recipe for controlling subprocesses: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440554 However, I can't figure out how I can send the equivalent of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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
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...

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.