python基础
文章平均质量分 50
qq_26365073
这个作者很懒,什么都没留下…
展开
-
python string.atof( )函数
string.atof(s)将字符串转为浮点型数字 >>> string.atof("1.23") 1.23 >>> string.atof("1") 1.0string.atoi(s,[base=num])将字符串转为整型数字,base 指定进制 >>> string.atoi("20") 20 >>> string.atoi("2转载 2016-05-13 21:56:14 · 10201 阅读 · 0 评论 -
python 同一个float值,id不同
在交互式解释器输入a和b 所指向的10000会被存入两个不同的PyCodeObject两个1,存入了不同的PyCodeObject,可是CPython有小整数Cache, 所以不管生成几次1,都是一样滴原创 2016-06-26 11:41:16 · 1320 阅读 · 0 评论 -
Python 字典中的中文输出问题
在Python2.X的版本中,定义字典时如果包含了中文,打印字典时中文会显示成码点,不会直接显示中文。例如:"font-family:Courier New;font-size:12px;">#coding=UTF-8 import json dict = {'Title': '这是标题'} print json.dumps(dict, ensure_ascii=False, e转载 2016-06-29 09:56:12 · 784 阅读 · 0 评论 -
python读写excel文件
传说中Python操作ms office功能最强大的是win32com,但只能要ms上使用。不过对于比较简单的需求显得有些小题大作。那么来看下简单的,分别是xlrd和xlwt模块,不过暂时只支持excel2003 ,但是可以跨平台操作。xlrdhttp://pypi.python.org/pypi/xlrd导入import xlrd打开exceldata转载 2016-06-30 11:49:18 · 293 阅读 · 0 评论 -
python学习的读书路线
python学习路线 python书籍推荐,python基础转载 2016-06-30 17:23:11 · 1723 阅读 · 1 评论 -
python接下来要看的书
the django bookpython cookbooklearning python原创 2016-06-30 17:44:42 · 352 阅读 · 0 评论 -
python urllib 和urllib2的区别
urllib仅接受url,提供urllib.urlencode方法用来获取查询字符串的产生urllib2可接受request示例来设置url请求的headers原创 2016-05-13 21:45:03 · 316 阅读 · 0 评论