Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > About UNIX shell trap, any relative function in Python ?

Reply
Thread Tools

About UNIX shell trap, any relative function in Python ?

 
 
moonhkt
Guest
Posts: n/a
 
      12-15-2012

Hi All

Machine : AIX 5.3
Python : 2.6.2

In UNIX have, trap to run defined CLEAN_UP function. When HUP INT
KILL STOP TERM will run CLEAN_UP function.

trap 'echo "\n\nProcessing Clean up"; CLEAN_UP; exit' HUP INT KILL
STOP TERM

Any relative function in Python ?

moonhkt
 
Reply With Quote
 
 
 
 
Chris Angelico
Guest
Posts: n/a
 
      12-15-2012
On Sun, Dec 16, 2012 at 2:34 AM, moonhkt <(E-Mail Removed)> wrote:
>
> Hi All
>
> Machine : AIX 5.3
> Python : 2.6.2
>
> In UNIX have, trap to run defined CLEAN_UP function. When HUP INT
> KILL STOP TERM will run CLEAN_UP function.
>
> trap 'echo "\n\nProcessing Clean up"; CLEAN_UP; exit' HUP INT KILL
> STOP TERM
>
> Any relative function in Python ?


Yep! Check out the 'signal' module:

http://docs.python.org/3.3/library/signal.html

ChrisA
 
Reply With Quote
 
 
 
 
Chris Angelico
Guest
Posts: n/a
 
      12-15-2012
On Sun, Dec 16, 2012 at 3:04 AM, Chris Angelico <(E-Mail Removed)> wrote:
> On Sun, Dec 16, 2012 at 2:34 AM, moonhkt <(E-Mail Removed)> wrote:
>>
>> Hi All
>>
>> Machine : AIX 5.3
>> Python : 2.6.2

>
> Yep! Check out the 'signal' module:
>
> http://docs.python.org/3.3/library/signal.html


Or, since you're working with 2.6.2:

http://docs.python.org/2.6/library/signal.html

ChrisA
 
Reply With Quote
 
moonhkt
Guest
Posts: n/a
 
      12-15-2012
On 12月16日, 上午12時05分, Chris Angelico <(E-Mail Removed)> wrote:
> On Sun, Dec 16, 2012 at 3:04 AM, Chris Angelico <(E-Mail Removed)> wrote:
> > On Sun, Dec 16, 2012 at 2:34 AM, moonhkt <(E-Mail Removed)> wrote:

>
> >> Hi All

>
> >> Machine : AIX 5.3
> >> Python : 2.6.2

>
> > Yep! Check out the 'signal' module:

>
> >http://docs.python.org/3.3/library/signal.html

>
> Or, since you're working with 2.6.2:
>
> http://docs.python.org/2.6/library/signal.html
>
> ChrisA


Thank. will try.
 
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
Re: How to pass shell variable to shell script from python D'Arcy J.M. Cain Python 0 02-27-2008 01:56 PM
Re: How to pass shell variable to shell script from python Gerardo Herzig Python 1 02-27-2008 12:19 PM
Re: How to pass shell variable to shell script from python Christian Heimes Python 0 02-27-2008 10:53 AM
501 PIX "deny any any" "allow any any" Any Anybody? Networking Student Cisco 4 11-16-2006 10:40 PM
can I run unix shell command in the ModelSim shell? clinton__bill@hotmail.com VHDL 2 02-18-2005 10:04 PM



Advertisments