How to timeout when executing command line programs in Python?

前端 未结 3 1463
南笙
南笙 2021-01-25 21:21

I am executing Maple from Python and would like to stop the program if it exceeds a maximum time. If its a Python function this can be done by using a timeout-decorator. But I a

3条回答
  •  暖寄归人
    2021-01-25 21:48

    I think you can use

    threading.Timer(TIME, function , args=(,))

    To execute function after a delay

提交回复
热议问题