会员
周边
众包
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Smile杰丶
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
5
6
7
8
9
2018年1月1日
文件打开编辑和函数参数
摘要: #f = open("yesterday2",'r+',encoding="utf-8") #文件句柄 读写#f = open("yesterday2",'w+',encoding="utf-8") #文件句柄 写读#f = open("yesterday2",'a+',encoding="utf-
阅读全文
posted @ 2018-01-01 15:50 Smile杰丶
阅读(232)
评论(0)
推荐(0)
2017年12月30日
python3编码问题个人理解
摘要: #coding=utf-8 a = "你" # 这个字符串是Unicode和 a = u“你”等价b = b'\\u4f60' #这个表示b是字节串(如果需要显示b的值则 print(b.decode("unicode-escape")) )系统会返回“你”这个值是因为它根据utf-8来给你解码pr
阅读全文
posted @ 2017-12-30 18:38 Smile杰丶
阅读(333)
评论(0)
推荐(0)
正文内容 python3编码问题
摘要: 来源:http://www.jb51.net/article/92006.htm 以下是全文: 这两天写了个监测网页的爬虫,作用是跟踪一个网页的变化,但运行了一晚出现了一个问题。。。。希望大家不吝赐教!我用的是python3,错误在对html response的decode时抛出,代码原样为: re
阅读全文
posted @ 2017-12-30 17:01 Smile杰丶
阅读(341)
评论(0)
推荐(0)
2017年12月25日
进度条制作
摘要: import sys,timefor i in range(10): sys.stdout.write("#") sys.stdout.flush() #不一次次刷新会导致一次性写完后才显示 time.sleep(0.5)
阅读全文
posted @ 2017-12-25 23:40 Smile杰丶
阅读(141)
评论(0)
推荐(0)
2017年12月24日
集合关系
摘要: list_1 = [1,4,5,7,3,6,7,9]list_1 = set(list_1)list_2 =set([2,6,0,66,22,8,4])print(list_1,list_2)'''#交集print( list_1.intersection(list_2) )#并集print(lis
阅读全文
posted @ 2017-12-24 20:29 Smile杰丶
阅读(243)
评论(0)
推荐(0)
字符串常用操作
摘要: name = "my \tname is {name} and i am {year} old" print(name.capitalize())name的首字母大写print(name.count("a")) name中a的数量print(name.center(50,"-"))总共打印50个字符
阅读全文
posted @ 2017-12-24 00:03 Smile杰丶
阅读(103)
评论(0)
推荐(0)
2017年12月21日
浅copy
摘要: person=['aaa',['a',bbb'] p1=copy.copy(person) p2=person[:] p3=list(person) p4=person.copy() print(type(p1)) 查看p1是什么格式,如int,str num.isdigit() 判断是否是全数字组
阅读全文
posted @ 2017-12-21 23:41 Smile杰丶
阅读(136)
评论(0)
推荐(0)
上一页
1
···
5
6
7
8
9
公告