Jacek Popławski wrote: > I am going to write python script which will read python command from > socket, run it and return some values back to socket. (Sounds like a huge security risk, unless you have tight control over who can connect to that socket.) > My problem is, that I need some timeout. I need to say for example: > > os.system("someapplication.exe") > > and kill it, if it waits longer than let's say 100 seconds > > I want to call command on separate thread, then after given timeout - > kill thread, but I realized (after reading Usenet archive) that there is > no way to kill a thread in Python. The issue isn't killing a thread in Python, it's killing the *new process* which that thread has started. To do that you have to rely on OS-specific (i.e. non-portable) techniques. Googling for "python kill process" would probably get you off to a good start. -Peter
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4