Created
October 11, 2016 14:14
-
-
Save kurozumi/10bb98bd14ccf3c9a2d57ac686a3622d to your computer and use it in GitHub Desktop.
【Python】Pythonで指定したpidのプロセスが存在するかチェック
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import psutil | |
pid = "pidを指定" | |
if psutil.pid_exists(pid): | |
print("{}は存在します。".format(pid)) | |
else: | |
print("{}は存在しません。".format(pid)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment