随笔分类 -  每天一个小程序 Python

摘要:#文件读写模式 #命令 read() 方法用于从文件读取指定的字节数,如果未给定或为负则读取所有。 readline() 读取整行,包括 "\n" 字符。 reaadlines() 读取所有行并返回列表,若给定sizeint>0,则是设置一次读多少字节,这是为了减轻读取压力 阅读全文
posted @ 2017-12-18 18:22 陈奕迅-可以了 阅读(171) 评论(0) 推荐(0) 编辑
摘要://测试环境 Python 2.7 安装 使用 img 是图片的地址。 code是验证码 阅读全文
posted @ 2017-10-24 09:46 陈奕迅-可以了 阅读(611) 评论(0) 推荐(0) 编辑
摘要:#-*- coding:utf-8 -*- class Car(object): # 静态字段 通过Car.country来访问.(静态字段属于类)(普通字段属于对象) country = '中国' def __init__(self,make,model,year): # 普通字段 obj.name self.make = ma... 阅读全文
posted @ 2017-09-23 18:24 陈奕迅-可以了 阅读(219) 评论(0) 推荐(0) 编辑
摘要:新式类,具有三种@property装饰器 经典类 阅读全文
posted @ 2017-09-23 18:23 陈奕迅-可以了 阅读(250) 评论(0) 推荐(0) 编辑
摘要:### ### ### 参考博客: http://blog.csdn.net/zyz511919766/article/details/25136485 阅读全文
posted @ 2017-09-21 11:01 陈奕迅-可以了 阅读(171) 评论(0) 推荐(0) 编辑
摘要:### ### ### 常用的: ### 阅读全文
posted @ 2017-09-21 10:59 陈奕迅-可以了 阅读(206) 评论(0) 推荐(0) 编辑
摘要:### curl命令 ### urllib2另外一种用法: ### ### 阅读全文
posted @ 2017-09-18 22:52 陈奕迅-可以了 阅读(10519) 评论(0) 推荐(0) 编辑
摘要:### 备注只是好奇测试了下。 和风天气官网地址:https://www.heweather.com/ 和风天气接口注册后可以免费试用。 ### 阅读全文
posted @ 2017-09-17 15:08 陈奕迅-可以了 阅读(3560) 评论(0) 推荐(0) 编辑
摘要:### if - else 如果2小于1,则b=1,否则b=2 ### ### 阅读全文
posted @ 2017-09-16 22:25 陈奕迅-可以了 阅读(175) 评论(0) 推荐(0) 编辑
摘要:### 现在我有一个简单的myfunc函数,现在我想对myfunc函数增加功能。下面我们增加一个deco的功能。 但是这种方式存在一个问题,修改了myfunc的原来的调用方式:myfunc() > 变成了 deco(myfunc)。所以我们做了下面的改变。 ### myfunc is myfuncm 阅读全文
posted @ 2017-09-14 22:30 陈奕迅-可以了 阅读(135) 评论(0) 推荐(0) 编辑
摘要:### 阅读全文
posted @ 2017-08-18 10:36 陈奕迅-可以了 阅读(991) 评论(0) 推荐(0) 编辑
摘要:### 版本1和版本2的区别就是一个会按照图片原来的顺序,一个直接给所有的文件重新命名。 ### 版本1 说明:修改os.listdir(path)下面的文件名,并且按 Newdir=os.path.join(path,'img'+numtag +filetype) 这个命名方式给文件重新命名。 版 阅读全文
posted @ 2017-08-09 18:26 陈奕迅-可以了 阅读(242) 评论(0) 推荐(0) 编辑
摘要:# # 阅读全文
posted @ 2017-07-30 18:18 陈奕迅-可以了 阅读(1405) 评论(0) 推荐(0) 编辑
摘要:# 阅读全文
posted @ 2017-07-29 12:03 陈奕迅-可以了 阅读(205) 评论(0) 推荐(0) 编辑
摘要:import socket,hashlib client = socket.socket() client.connect(("localhost", 6971)) ##开始连接 (ServerIP,ServerPort) while True: cmd = input("Please input the message>>").strip() print(cmd) ... 阅读全文
posted @ 2017-07-29 12:02 陈奕迅-可以了 阅读(275) 评论(0) 推荐(0) 编辑
摘要:-0- 阅读全文
posted @ 2017-07-28 19:21 陈奕迅-可以了 阅读(254) 评论(0) 推荐(0) 编辑
摘要:--0-- 阅读全文
posted @ 2017-07-28 19:20 陈奕迅-可以了 阅读(662) 评论(0) 推荐(0) 编辑
摘要:1.字典 2.str 3.tuple 元组 阅读全文
posted @ 2017-06-29 11:11 陈奕迅-可以了 阅读(137) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示