LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices



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

Rep: Reputation: 20
Timeout function using Python


hi,

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,
Vishnu

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

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


Reply

Tags
python


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 09:21 AM
ata2: command 0xca timeout arapidsfan Linux - Hardware 0 09-11-2006 08:12 PM
timeout system call yhus Programming 1 09-01-2006 07:26 AM
ad0:READ command timeout BongMong *BSD 1 07-09-2004 12:57 AM
system wont run command jackopa Linux - General 3 12-20-2001 04:08 PM


All times are GMT -5. The time now is 08:14 AM.

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