# os.kill ()

### os.kill ( *pid*, *sig* )

Отправляет сигнал ***sig*** на ***pid*** процесса. Константы для конкретных сигналов, доступных на платформе хоста, определены в модуле сигналов [signal](/python-docs/moduli-standartnoi-biblioteki-1/setevoe-i-mezhprocessnoe-vzaimodeistvie/signal.md).

**Windows**: сигналы [signal.CTRL\_C\_EVENT](/python-docs/moduli-standartnoi-biblioteki-1/setevoe-i-mezhprocessnoe-vzaimodeistvie/signal/konstanty-signalov/signal.ctrl_c_event.md) и [signal.CTRL\_BREAK\_EVENT](/python-docs/moduli-standartnoi-biblioteki-1/setevoe-i-mezhprocessnoe-vzaimodeistvie/signal/konstanty-signalov/signal.ctrl_break_event.md) являются специальными сигналами, которые могут быть отправлены только консольным процессам, которые совместно используют общее окно консоли, например, некоторым подпроцессам. Любое другое значение для ***sig*** приведет к тому, что процесс будет безоговорочно завершен API-интерфейсом TerminateProcess, а код выхода будет установлен на ***sig***. Версия **kill ()** для Windows дополнительно требует уничтожения дескрипторов процесса.

См. также [signal.pthread\_kill ()](/python-docs/moduli-standartnoi-biblioteki-1/setevoe-i-mezhprocessnoe-vzaimodeistvie/signal/funkcii-modulya-signal/signal.pthread_kill.md).

Вызывает событие аудита `os.kill` с аргументами ***pid***, ***sig***.

*Новое в версии 3.2:* поддержка Windows.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://treasuremaster.gitbook.io/python-docs/moduli-standartnoi-biblioteki-1/obshie-sluzhby-operacionnoi-sistemy/os/upravlenie-processami/os.kill.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
