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

推荐订阅源

Know Your Adversary
Know Your Adversary
云风的 BLOG
云风的 BLOG
Recent Announcements
Recent Announcements
F
Fortinet All Blogs
B
Blog
罗磊的独立博客
宝玉的分享
宝玉的分享
Vercel News
Vercel News
Martin Fowler
Martin Fowler
N
Netflix TechBlog - Medium
P
Proofpoint News Feed
T
Threatpost
Security Latest
Security Latest
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Stack Overflow Blog
Stack Overflow Blog
I
Intezer
P
Privacy International News Feed
D
Docker
月光博客
月光博客
博客园 - 三生石上(FineUI控件)
M
MIT News - Artificial intelligence
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
L
Lohrmann on Cybersecurity
Google DeepMind News
Google DeepMind News
The Last Watchdog
The Last Watchdog
A
Arctic Wolf
IT之家
IT之家
S
SegmentFault 最新的问题
S
Securelist
博客园 - 叶小钗
N
News and Events Feed by Topic
F
Full Disclosure
Security Archives - TechRepublic
Security Archives - TechRepublic
Engineering at Meta
Engineering at Meta
Hacker News: Ask HN
Hacker News: Ask HN
博客园 - Franky
GbyAI
GbyAI
AI
AI
Y
Y Combinator Blog
WordPress大学
WordPress大学
Latest news
Latest news
Microsoft Security Blog
Microsoft Security Blog
人人都是产品经理
人人都是产品经理
N
News | PayPal Newsroom
The Cloudflare Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
I
InfoQ

博客园 - 闫磊博客

C#获取当前时间的各种格式 ArcEngine这本书怎么样 asp.net 中Session和Application使用 ASP.NET页面间的传值的几种方法 ArcGIS Engine开发-TOCControl中实现图层的拖动 asp.net学习日志 - 闫磊博客 - 博客园 C# 获取局域网内IP的MAC Delphi中MediaPlayer控件的使用 arcgis中数字模糊查询 - 闫磊博客 - 博客园 1:25万地形数据库数据说明 国土资源部2009.12.31 关于县(市)级土地调查数据库建库软件数据更新功能测试结果(第一批)的公告 arcgis python 列举所有dataset ListDatasets - 闫磊博客 arcgis python 列举所有栅格ListRasters - 闫磊博客 arcgis python 获得消息的个数 - 闫磊博客 arcgis python 获得参数个数 arcgis python 数据更新 - 闫磊博客 ColorRamp对象 生成色带 C#如何将dataGridView内容载入DataSet中 python获得当前目录下文件,并写到name.txt
python 例子生成随机数,读文件
闫磊博客 · 2009-12-28 · via 博客园 - 闫磊博客

代码

 1 #生成随机数
 2 import random    #这个是注释,引入模块
 3 rnd = random.randint(1,500)#生成1-500之间的随机数
 4 print rnd
 5 
 6 #读文件
 7 import os
 8 = open("c://1.txt","r"
 9 lines = f.readlines()#读取全部内容
10 for line in lines:
11     print line

posted @ 2009-12-28 11:07  闫磊博客  阅读(438)  评论(0)    收藏  举报