![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
imarch1
这个作者很懒,什么都没留下…
展开
-
6 Lessons From Dropbox - One Million Files Saved Every 15 Minutes
Dropbox saves one million files every 15 minutes, more tweets than even Twitterers tweet. That mind blowing statistic was revealed by Ria转载 2011-09-01 12:51:47 · 325 阅读 · 0 评论 -
range 与 xrange 的区别
在 Python 中,range 和 xrange 均可以用来做迭代的范围,不过 range 返回的是 list,而 xrange 则返回一个 xrange object。for x in range(1000):will generate a list原创 2011-09-03 15:04:04 · 352 阅读 · 0 评论 -
读取大文件
通常读取文件的方法是:for line in open('myfile','r').readlines() 但问题是会将整个文件读入内存,所以对于大文件此方法不适合。下面的方法会一行一行地读取文件:import fileinputfor lin原创 2011-09-06 15:08:24 · 195 阅读 · 0 评论 -
操作系统的判断
import os;if os.name == "nt": # windows blabla;elif os.name == "posix": # linux blabla;原创 2011-12-04 17:17:53 · 473 阅读 · 0 评论 -
不同操作系统中的换行符
Windows: \nLinux: \r\nUnix: \r原创 2011-12-04 17:13:41 · 590 阅读 · 2 评论 -
字典的遍历
for i in xrange(0, len(dict)): key = dict.keys()[i]; # key 是第i个索引原创 2011-12-04 17:16:00 · 259 阅读 · 0 评论 -
字符与数字的相互转化
str(num); # 将数字转化位字符串import string;string.atoi(str); # 将字符串转化位整数string.atof(str); # 将字符串转化位小数原创 2011-12-05 17:21:55 · 314 阅读 · 0 评论