Python 进程,获取进程id os getpid

               
import ospid=os.fork() #fork反复拷贝if  pid==0:    print("A",os.getpid(),os.getppid())else:    print("B",os.getpid(),os.getppid())# os.getpid()获取当前进程id     os.getppid()获取父进程id

           

猜你喜欢

转载自blog.csdn.net/qq_44952790/article/details/89452061