About UNIX shell trap, any relative function in Python ?

Discussion in 'Python' started by moonhkt, Dec 15, 2012.

  1. moonhkt

    moonhkt Guest

    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
     
    moonhkt, Dec 15, 2012
    #1
    1. Advertising

  2. On Sun, Dec 16, 2012 at 2:34 AM, moonhkt <> 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
     
    Chris Angelico, Dec 15, 2012
    #2
    1. Advertising

  3. Chris Angelico, Dec 15, 2012
    #3
  4. moonhkt

    moonhkt Guest

    On 12月16æ—¥, 上åˆ12時05分, Chris Angelico <> wrote:
    > On Sun, Dec 16, 2012 at 3:04 AM, Chris Angelico <> wrote:
    > > On Sun, Dec 16, 2012 at 2:34 AM, moonhkt <> 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.
     
    moonhkt, Dec 15, 2012
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    5,787
    Jonathan Bromley
    Feb 18, 2005
  2. Christian Heimes
    Replies:
    0
    Views:
    613
    Christian Heimes
    Feb 27, 2008
  3. Gerardo Herzig
    Replies:
    1
    Views:
    1,108
    Philipp Pagel
    Feb 27, 2008
  4. D'Arcy J.M. Cain
    Replies:
    0
    Views:
    879
    D'Arcy J.M. Cain
    Feb 27, 2008
  5. edwithad

    Bash shell to Python shell?

    edwithad, Sep 28, 2009, in forum: Python
    Replies:
    4
    Views:
    1,773
Loading...

Share This Page