nickkkkkkk

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::

2018年4月25日

摘要: __author__ = "Alex Li" data = open("yesterday",encoding="utf-8").read() f = open("yesterday2",'a',encoding="utf-8") 文件句柄 #a = append 追加 写方式打开文件,新创建一个y 阅读全文
posted @ 2018-04-25 15:36 nickkkkkkk 阅读(170) 评论(0) 推荐(0)

摘要: 出处: http://blog.csdn.net/ztf312/ 第一步 排除文件打开方式错误: r只读,r+读写,不创建 w新建只写,w+新建读写,二者都会将文件内容清零 (以w方式打开,不能读出。w+可读写) w+与r+区别: r+:可读可写,若文件不存在,报错;w+: 可读可写,若文件不存在, 阅读全文
posted @ 2018-04-25 15:03 nickkkkkkk 阅读(9329) 评论(0) 推荐(0)

摘要: __author__ = "Alex Li" 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.inter 阅读全文
posted @ 2018-04-25 12:07 nickkkkkkk 阅读(131) 评论(0) 推荐(0)

摘要: __author__ = "Alex Li" #key-value av_catalog = { "欧美":{ "www.youporn.com": ["很多免费的,世界最大的","质量一般"], "www.pornhub.com": ["很多免费的,也很大","质量比yourporn高点"], " 阅读全文
posted @ 2018-04-25 10:46 nickkkkkkk 阅读(172) 评论(0) 推荐(0)

摘要: __author__ = "Alex Li" import copy #names = "ZhangYang Guyun Xiangpeng XuLiangChen" names = ["4ZhangYang", "#!Guyun","xXiangPeng",["alex","jack"],"Che 阅读全文
posted @ 2018-04-25 10:45 nickkkkkkk 阅读(112) 评论(0) 推荐(0)

摘要: 三种格式化输出 # Author:Alex Li name = input("name:") #raw_input 2.x input 3.x #input 2.x = age = int(input("age:") ) #integer 类型转换 print(type(age) , type( s 阅读全文
posted @ 2018-04-25 10:45 nickkkkkkk 阅读(102) 评论(0) 推荐(0)

摘要: lock_file = open('C:\\aaaaaaaaaaaaa\\custom.txt','r+') lock = lock_file.read().split("\n") print(lock) usrname = input("请输入您的名字:") not_new_custom = li 阅读全文
posted @ 2018-04-25 10:39 nickkkkkkk 阅读(146) 评论(0) 推荐(0)

只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2018-04-25 10:37 nickkkkkkk 阅读(14) 评论(0) 推荐(0)

摘要: lock_file = open('C:\\aaaaaaaaaaaaa\\ccc.txt','r+') ###以可读可写的方式打开文件,如果打开后先读过一次文件,则写文件是以追加的方式写的 lock = lock_file.read().split("\n") ###读文件,并按照换行符将文件分隔开 阅读全文
posted @ 2018-04-25 10:25 nickkkkkkk 阅读(90) 评论(0) 推荐(0)