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

Python 协程

时间:2016-01-13 21:40:28      阅读:263      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!