python 程序优雅重启

    def restart_program(self):
        print("restart")
        python = sys.executable #获取当前执行python 
        os.execl(python, python, *sys.argv)  #执行命令

通过产生子进程取代原进程

猜你喜欢

转载自blog.csdn.net/weixin_33693070/article/details/86858110
今日推荐