码迷,mamicode.com
首页 > 编程语言 > 详细

Python 进程与多线程

时间:2017-11-28 19:52:15      阅读:171      评论:0      收藏:0      [点我收藏+]

标签:进程   tpi   coding   create   child   created   creat   for   ted   

10 进程和多线程

      10.1 多进程

                  

# -*- coding: utf-8 -*-

import os

pid=os.fork()

print (‘process (%s)start ...‘ %os.getpid())

if pid==0:

         print(‘I am child process (%s) and my parent is %s.‘ % (os.getpid(), os.getppid()))

else:

        print(‘I (%s) just created a child process (%s).‘ % (os.getpid(), pid))

Python 进程与多线程

标签:进程   tpi   coding   create   child   created   creat   for   ted   

原文地址:http://www.cnblogs.com/smartwen666/p/7911357.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!