Cross-platform way to get PIDs by process name in python

后端 未结 8 1070
后悔当初
后悔当初 2020-12-02 09:35

Several processes with the same name are running on host. What is the cross-platform way to get PIDs of those processes by name using python or jyth

8条回答
  •  失恋的感觉
    2020-12-02 10:20

    First, Windows (in all it's incarnations) is a non-standard OS.

    Linux (and most proprietary unixen) are POSIX-compliant standard operating systems.

    The C libraries reflect this dichotomy. Python reflects the C libraries.

    There is no "cross-platform" way to do this. You have to hack up something with ctypes for a particular release of Windows (XP or Vista)

提交回复
热议问题