File tree Expand file tree Collapse file tree 1 file changed +0
-21
lines changed Expand file tree Collapse file tree 1 file changed +0
-21
lines changed Original file line number Diff line number Diff line change @@ -280,24 +280,3 @@ How do I check for a keypress without blocking?
280
280
Use the msvcrt module. This is a standard Windows-specific extension module.
281
281
It defines a function ``kbhit() `` which checks whether a keyboard hit is
282
282
present, and ``getch() `` which gets one character without echoing it.
283
-
284
-
285
- How do I emulate os.kill() in Windows?
286
- --------------------------------------
287
-
288
- Prior to Python 2.7 and 3.2, to terminate a process, you can use :mod: `ctypes `:
289
-
290
- .. code-block :: python
291
-
292
- import ctypes
293
-
294
- def kill (pid ):
295
- """ kill function for Win32"""
296
- kernel32 = ctypes.windll.kernel32
297
- handle = kernel32.OpenProcess(1 , 0 , pid)
298
- return (0 != kernel32.TerminateProcess(handle, 0 ))
299
-
300
- In 2.7 and 3.2, :func: `os.kill ` is implemented similar to the above function,
301
- with the additional feature of being able to send :kbd: `Ctrl + C ` and :kbd: `Ctrl + Break `
302
- to console subprocesses which are designed to handle those signals. See
303
- :func: `os.kill ` for further details.
You can’t perform that action at this time.
0 commit comments