Skip to content

bpo-35220: delete "how do I emulate os.kill" section in Windows FAQ #10487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 23, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions Doc/faq/windows.rst
Original file line number Diff line number Diff line change
Expand Up @@ -302,26 +302,6 @@ It defines a function ``kbhit()`` which checks whether a keyboard hit is
present, and ``getch()`` which gets one character without echoing it.


How do I emulate os.kill() in Windows?
--------------------------------------

Prior to Python 2.7 and 3.2, to terminate a process, you can use :mod:`ctypes`:

.. code-block:: python

import ctypes

def kill(pid):
"""kill function for Win32"""
kernel32 = ctypes.windll.kernel32
handle = kernel32.OpenProcess(1, 0, pid)
return (0 != kernel32.TerminateProcess(handle, 0))

In 2.7 and 3.2, :func:`os.kill` is implemented similar to the above function,
with the additional feature of being able to send :kbd:`Ctrl+C` and :kbd:`Ctrl+Break`
to console subprocesses which are designed to handle those signals. See
:func:`os.kill` for further details.

How do I extract the downloaded documentation on Windows?
---------------------------------------------------------

Expand Down