Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 07-07-2009, 01:04 PM   #1
Registered: Jan 2006
Location: India
Distribution: Ubuntu, RHEL, Debian
Posts: 49

Rep: Reputation: 20
Timeout function using Python


I want to implement this;
step 1 : Run a system command (linux) and start a timer.
step 2 : The command should be terminated if it is not completed within the given time.
step 3 : Fetch the output of the command from the stdout if commands completes (or gives an error) within the given time.

I googled a little; but didn't find something useful. I would appreciate it very much if you could add comments (as many as you can) and make the code descriptive because am not a quick learner and don't have much experience in Python coding.

Thank you for helping,

Last edited by vishnu_sreekumar; 07-07-2009 at 01:06 PM.
Old 08-03-2009, 04:52 AM   #2
LQ Newbie
Registered: Sep 2008
Posts: 9

Rep: Reputation: 0
use pexpect python module. use pxssh for pexpect over an ssh connection



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to test whether a command timeout? DriveMeCrazy Programming 3 01-11-2007 08:21 AM
ata2: command 0xca timeout arapidsfan Linux - Hardware 0 09-11-2006 07:12 PM
timeout system call yhus Programming 1 09-01-2006 06:26 AM
ad0:READ command timeout BongMong *BSD 1 07-08-2004 11:57 PM
system wont run command jackopa Linux - General 3 12-20-2001 03:08 PM

All times are GMT -5. The time now is 01:34 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration