上一页 1 ··· 56 57 58 59 60 61 62 63 64 ··· 66 下一页
摘要: property属性:自动调用get、set方法 每次调用隐藏的数据,都用get和set方法写的字符太长,就用property解决。 方法一:使用property()函数升级get、set方法 源代码: class Money(object): def __init__(self): self.__ 阅读全文
posted @ 2018-01-16 23:47 安迪9468 阅读(536) 评论(0) 推荐(0) 编辑
摘要: get请求 post传参 阅读全文
posted @ 2018-01-12 20:39 安迪9468 阅读(410) 评论(0) 推荐(0) 编辑
摘要: https://www.cnblogs.com/yyds/p/6901864.html 日志模块的简单使用 python 获取当前调用函数名等log信息 阅读全文
posted @ 2018-01-12 14:43 安迪9468 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 方法一:(推荐) 方法二:codecs http://blog.csdn.net/mbugatti/article/details/53925236 阅读全文
posted @ 2018-01-10 14:07 安迪9468 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 自动化工具 一次性从git远程仓库中克隆到本地。 阅读全文
posted @ 2018-01-10 11:40 安迪9468 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 返回随机数:整数、浮点数 # -*- coding: utf-8 -*- import random # 产生0-1之间的浮点数 random.random() # 产生0-12之间的浮点数 random.random() * 12 # 返回指定范围的随机整数:不包含60 random.randra 阅读全文
posted @ 2018-01-10 09:52 安迪9468 阅读(227) 评论(0) 推荐(0) 编辑
摘要: python实现下载进度条 案例2 延伸:正在加载...... 阅读全文
posted @ 2018-01-10 09:43 安迪9468 阅读(175) 评论(0) 推荐(0) 编辑
摘要: os模块的使用 https://www.cnblogs.com/juandx/p/4962089.html 当前文件的名称:os.path.basename(__file__) 注意:新建和关闭文件,可以直接用,无需os模块 python中对文件、文件夹(文件操作函数)的操作需要涉及到os模块和sh 阅读全文
posted @ 2018-01-09 23:31 安迪9468 阅读(351) 评论(0) 推荐(0) 编辑
摘要: 方法1: 读取文件中的json字符串, 再用json.loads转为python字典 方法2: 直接用文件游标f,将json字符串连同读取和转成python字典一步完成。此时用的是josn.load(f) 结论: json模块中的loads和load的区别是: loads是将f游标中的字符串先读取出 阅读全文
posted @ 2018-01-09 18:20 安迪9468 阅读(15750) 评论(0) 推荐(1) 编辑
摘要: +++++++++++++++++++++++++++++ python执行shell命令1 os.system (只有这个方法是边执行边输出,其他方法是最后一次性输出) 可以返回运行shell命令状态,同时会在终端输出运行结果 例如 ipython中运行如下命令,返回运行状态status os.s 阅读全文
posted @ 2018-01-09 17:20 安迪9468 阅读(8811) 评论(0) 推荐(0) 编辑
上一页 1 ··· 56 57 58 59 60 61 62 63 64 ··· 66 下一页