打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
python 双色球
#!/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!'
~
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
防止Python的stdout被缓存的几种方法
用 Python 给程序加个进度条,让你的程序看起来更炫酷
ASPN : Python Cookbook : [Twisted] From block...
Python:如何显示进度条
Python少有人走过的坑
一个极其简单的Python网页抓取程序
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服