惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Blog of Author Tim Ferriss
Know Your Adversary
Know Your Adversary
P
Palo Alto Networks Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
K
Kaspersky official blog
L
LINUX DO - 热门话题
P
Proofpoint News Feed
P
Privacy & Cybersecurity Law Blog
Google DeepMind News
Google DeepMind News
Attack and Defense Labs
Attack and Defense Labs
Cisco Talos Blog
Cisco Talos Blog
AI
AI
L
LINUX DO - 最新话题
H
Heimdal Security Blog
Hacker News: Ask HN
Hacker News: Ask HN
Webroot Blog
Webroot Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
The GitHub Blog
The GitHub Blog
I
Intezer
Blog — PlanetScale
Blog — PlanetScale
有赞技术团队
有赞技术团队
S
Securelist
博客园_首页
IT之家
IT之家
Schneier on Security
Schneier on Security
博客园 - 叶小钗
罗磊的独立博客
WordPress大学
WordPress大学
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
MongoDB | Blog
MongoDB | Blog
P
Proofpoint News Feed
阮一峰的网络日志
阮一峰的网络日志
A
Arctic Wolf
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
W
WeLiveSecurity
The Register - Security
The Register - Security
D
DataBreaches.Net
S
Security @ Cisco Blogs
Security Archives - TechRepublic
Security Archives - TechRepublic
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
腾讯CDC
Recorded Future
Recorded Future
NISL@THU
NISL@THU
N
News and Events Feed by Topic
T
Tailwind CSS Blog
N
News and Events Feed by Topic
Cyberwarzone
Cyberwarzone
T
Tor Project blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com

博客园 - 鱼跃千里

右键菜单添加CMD--备忘 - 鱼跃千里 - 博客园 windows 7安装sql server2005以及com (-1073737712错误)+ 8004e00f错误 Nhibernate 2.0 学习笔记,关于hbm映射文件的重要性 要签约了 [转]虚方法和抽象方法 腾讯笔试 IE7不能支持Google的Google Suggest? 两个不错的生成图片验证码代码 继承类实例化时构造函数的执行顺序 FCKEditor的使用---起步 [转+自己修改]将 MS SQL Server 2005 SP2 整合到安装文件 Google AdSense 申请通过了 [转]发生 LC.exe 已经退出 代码-1 错误的解决方法 [转]VS2005 SP1集成版制作 DataList等控件嵌套绑定的一个需要注意的地方 为DataList和GridView内容项添加序号 超时时间已到。在操作完成之前超时时间已过或服务器未响应。 (.Net SqlClient Data Provider) [转]最佳ASP.NET编程习惯 DataList嵌套绑定数据
Python抽奖程序 - 鱼跃千里 - 博客园
鱼跃千里 · 2010-12-20 · via 博客园 - 鱼跃千里

恩,就是下面的这段程序

代码

#!/usr/bin/env python
#
 -*- coding: utf-8 -*-

import os
import sys
import random#设定只有5个人可以中
n_tickets = 5
#设定参与抽奖的人,可以一直扩充
pname = ("小洁","宁宁","拉拉","小派","","","3","4","5","6","7","8","9","10","11","13","12")#随机抽奖,想了解可以看看 http://apps.hi.baidu.com/share/detail/24178346
slice = random.sample(pname, n_tickets)

type 

= sys.getfilesystemencoding()#后面就是打印出来而已
print "恭喜以下同学获得奖品:".decode('UTF-8').encode(type)
print
for x in range(n_tickets-1):
    
print slice[x],
    
if not (x+1% 5:
        
print        
print
print

os.system(

"pause")