[英]communication between python programs
我有一個在Linux上作為守護進程運行的python程序。
如何從另一個python程序發送這個守護進程的信號?
使用os.kill發送信號。 信號在信號模塊中定義。 你只需要以某種方式獲取守護進程的pid。
還有一件事 - 您也可以使用信號模塊來注冊信號處理程序。
如果您需要比簡單信號更復雜的東西,請考慮使用像PYRO這樣的RPC庫。 這樣做的好處是,即使您必須將流程移動到單獨的服務器,也可以使用它。
或者,如果您主要針對Linux系統,那么請查看使用DBUS 。 有一個python庫,現在甚至在Windows上都支持它。
您是否嘗試過閱讀Python中進程間通信的文檔? 這是一個鏈接:
http://docs.python.org/library/ipc.html
任何其他類型的信令都是可能的,但這些可能是最常見的。
[英]communication between 2 programs in python
[英]Communication between two python programs
[英]Python simple communication between python programs?
[英]Inter-process communication between Python and Scala programs
[英]Communication between python objects?
[英]Communication between class in Python
[英]Communication between processing and Python?
[英]Communication between OCaml and Python
[英]Communication between Python Scripts
[英]Communication between Arduino and Python
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.