def pid():
"""
获取pid 保存到var/run/task.pid
"""
pid = os.getpid()
print(pid)
with open(file='/var/run/task.pid', mode='w') as f:
f.writelines(str(pid))
def pid():
"""
获取pid 保存到var/run/task.pid
"""
pid = os.getpid()
print(pid)
with open(file='/var/run/task.pid', mode='w') as f:
f.writelines(str(pid))
本文标题:python 获取pid
本文链接:https://www.haomeiwen.com/subject/whcbtltx.html
网友评论