python如何编写一个同步程序?

[复制链接]
查看11 | 回复2 | 2013-8-6 10:49:16 | 显示全部楼层 |阅读模式
用线程吧,给你一个简单的线程实例,真的需要同步的话再做个共享变量,来同步文字和音乐import threadingimport timeclass printscreen(threading.Thread):
def __init__(self,name=None):
threading.Thread.__init__(self,name=None)
def run(self):
for i in range(5):
time.sleep(2)
print "print screen"class music(threa...
回复

使用道具 举报

千问 | 2013-8-6 10:49:16 | 显示全部楼层
用pygame.mixer.music...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行