创建contex后获取python deamon pid

2024-10-02 10:19:06 发布

您现在位置:Python中文网/ 问答频道 /正文

使用python deamon,可以打印此deamon的pid吗? 我想要这样:

import daemon

context = daemon.DaemonContext()
with context():
    do_main_program()
print("pid of deamon : " + str(context.pid))

谢谢你提前通知


Tags: ofimportmainwithcontextprogrampiddo

热门问题