Python Programming in Linux Question

Discussion in 'Linux & BSD' started by Gracey, Mar 2, 2009.

  1. Gracey

    Gracey OSNN One Post Wonder

    Messages:
    2
    Hello,
    I was wondering how i catch various signals in nix python so i can exit my programs gracefully? Please tell me

    Thanks
     
    Last edited: Mar 4, 2009
  2. Webby Alisha

    Webby Alisha OSNN One Post Wonder

    Messages:
    1
    Re: Linux Question

    Simply "import signal", and see documention of that module. But bear in mind that signals are weird with Python.
    The atomic unit of Python execution can span a C external function
    call, and that can take an indefinitely long time. So delivery of
    signals at the Python level can be delayed.
     
    Last edited by a moderator: Mar 26, 2009
  3. Xie

    Xie - geek - Subscribed User Folding Team

    Messages:
    5,275
    Location:
    NY, USA
    Re: Linux Question

    You should add the fact that your looking for Python help in the title as it's not really a "Linux" question but more of a programming one. ;)
     
  4. fitz

    fitz Just Floating Along Staff Member Political User Folding Team

    Messages:
    4,076
    Location:
    Chicagoland
    *title changed*