python Time a try except
问题 My problem is very simple. I have a try/except code. In the try I have some http requests attempts and in the except I have several ways to deal with the exceptions I'm getting. Now I want to add a time parameter to my code. Which means the try will only last for 'n' seconds. otherwise catch it with except. In free language it would appear as: try for n seconds: doSomthing() except (after n seconds): handleException() this is mid-code. Not a function. and I have to catch the timeout and