随笔分类 -  python

python: 添加自定义模块路径 —— 可以使用相对路径
摘要:自定义模块时,添加模块路径: 阅读全文

posted @ 2016-10-17 16:24 ZhYQ_note 阅读(1738) 评论(0) 推荐(0) 编辑

python: int to unicode string
摘要:>>> import types >>> print type(str(2)) >>> print type(str('2')) # 这里先转为str,在转为unicode >>> print type(str(2).decode('utf-8')) >>> print type(str('32').decode('utf-8')) >>> print str(2).decode('utf... 阅读全文

posted @ 2016-10-14 19:36 ZhYQ_note 阅读(959) 评论(0) 推荐(0) 编辑

PyCharmIDE: 给脚本传递参数
摘要: 阅读全文

posted @ 2016-10-14 17:34 ZhYQ_note 阅读(1445) 评论(0) 推荐(0) 编辑

python: str()
摘要:tx1 = '中国' tx2 = u'中国' print tx1 print tx2 print type(tx1) print type(tx2)# str()函数会把unicode的字符串转成str形式的,使用的时候要注意print type(str(tx2)) 中国 中国 阅读全文

posted @ 2016-10-14 14:57 ZhYQ_note 阅读(185) 评论(0) 推荐(0) 编辑

python: isdigit int float 使用
摘要:>>> num1 = '2.0' >>> print num1.isdigit() False >>> num2 = '2' >>> print num2.isdigit() True >>> num3 = '-3' >>> print num3.isdigit() False >>> num4 = 阅读全文

posted @ 2016-10-14 14:12 ZhYQ_note 阅读(563) 评论(0) 推荐(0) 编辑

python字符串转整形异常
摘要:python字符串转整形异常 问题 在使用int("xx")转化字符串为整形时,如果字符串是float形式,这样转化会异常 解决: 先转化为浮点型,在转化为整形 实例: 阅读全文

posted @ 2016-10-11 10:32 ZhYQ_note 阅读(1661) 评论(0) 推荐(0) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示