首页 > 编程语言 > 详细

Python 协程

时间:2016-01-13 21:37:41      阅读:201      评论:0      收藏:0      [点我收藏+]
def GenerateProcess():
    filelocal = rc:\Te
    for i in range(10):
        baiWei = i * 100
        filename = [None] * 100
        filelocalation = [None] * 100
        for j in range(100):
            filename_pre = baiWei + j + 1
            filename[j] = "%s.avi" % filename_pre
            filelocalation[j] = filelocal + "\\" + filename[j]
        print filelocalation
        yield multiprocessing.Process(target=upload, args=(filename, filelocalation))

def ExecuteProcess(G):
    h = G.next()
    for i in range(10):
        h.start()
        h = G.send(‘‘)

if __name__==__main__:

    a = GenerateProcess()
    ExecuteProcess(a)

 

Python 协程

原文:http://www.cnblogs.com/haoshine/p/5128455.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!