分享

python 双色球

 子歌-特斯拉 2016-05-31
#!/usr/bin/env python
import os,sys,random
ball=[]
out_ball=[]
bule_ball=[]
try:
        for i in range(1,34):
                ball.insert(i-1,i)
        for i in range(1,17):
                bule_ball.insert(i-1,i)
        print 'Ball is:'
        for i in range(0,6):
                os.system('sleep '+str(random.randint(1,6)))
                out_ball.insert(i,ball.pop(int(random.random()*(33-i))))
                out_ball.sort()
        for i in range(0,6):
                os.system('sleep 1')
                sys.stdout.write('\033[41;63m '+str(out_ball[i])+' \033[0m ')
                sys.stdout.flush()
        for i in range(0,1):
                        os.system('sleep '+str(random.randint(1,6)))
                        sys.stdout.write( '\033[44;44m '+str(ball.pop(int(random.random()*(16-i))))+' \033[0m\n')
except:
                print 'System happend Error,pls retry!'
~

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多