티스토리 뷰

공부

[Python] execute timeout

seunggabi 승가비 2020. 5. 31. 11:59
import signal
signal.alarm(10)

https://stackoverflow.com/questions/492519/timeout-on-a-function-call

 

Timeout on a function call

I'm calling a function in Python which I know may stall and force me to restart the script. How do I call the function or what do I wrap it in so that if it takes longer than 5 seconds the script

stackoverflow.com

 

댓글
댓글쓰기 폼