Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Best Way To Bound Function Execution Time

Reply
Thread Tools

Best Way To Bound Function Execution Time

 
 
Tim Daneliuk
Guest
Posts: n/a
 
      12-31-2011
I am writing some paramiko-based ssh routines. One of them logs into
a remote server and then does a sudo command. The problem is that if
the user provides the incorrect sudo password, the call hangs the other
end is waiting for the correct password to be entered.

Is there some standard Pythonic way to bound how long a function
call can run, after which time it is forcefully terminated?

TIA,
--
----------------------------------------------------------------------------
Tim Daneliuk
PGP Key: http://www.tundraware.com/PGP/

 
Reply With Quote
 
 
 
 
Paul Rubin
Guest
Posts: n/a
 
      12-31-2011
Tim Daneliuk <> writes:
> Is there some standard Pythonic way to bound how long a function
> call can run, after which time it is forcefully terminated?


Basically, run it in a separate process and use os.kill to kill it.
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Lower bound & Upper bound sunil panda Java 9 10-07-2008 08:32 PM
Passing Bound Object value to another Bound Object Phillip Vong ASP .Net 0 07-27-2006 10:54 PM
How to represent the data in a not bound control via bound control Mario Krsnic ASP .Net 0 06-23-2006 07:38 AM
What's the Best Way to Time a Program's Execution? kvnsmnsn@hotmail.com Java 8 03-29-2006 05:38 PM
Getting lower-bound and upper-bound of strings input Rhiner Dan C++ 1 03-27-2005 02:03 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57