随笔分类 -  python

开发工具
摘要:python在读取文件时出现“UnicodeDecodeError:'gbk' codec can't decode byte 0x89 in position 68: illegal multibyte sequence”错误 翻译为:“GBK”编解码器不能解码位置68中的字节0x89:非法多字节 阅读全文
posted @ 2019-02-15 15:43 飘零0 阅读(5423) 评论(0) 推荐(0) 编辑
摘要:首先是一张总结的图: 对各个不同的通信进行解分: 1、http通信详解 2、cookie通信图: 3、cookie管理的session信息 4、token通信 阅读全文
posted @ 2019-01-04 18:17 飘零0 阅读(151) 评论(0) 推荐(0) 编辑
摘要:''' 根据字符串的形式去某个模块中寻找东西-->getattr() 根据字符串的形式去某个模块中判断东西是否存在-->hasattr() 根据字符串的形式去某个模块中设置东西-->setattr() 根据字符串的形式去某个模块中删除东西-->delattr() ''' # # 通过__import__导入目标模块 # f=__import__('login') # # 通过对象找login模... 阅读全文
posted @ 2019-01-02 15:14 飘零0 阅读(73) 评论(0) 推荐(0) 编辑
摘要:'''模块与模块之间的调用''' import first #调用整个变量 print(first.Index) # #调用函数 print(first.hello()) # per = first.Index() per.hello() from first import * # per = Index() per.hello() # hello() #包与包之间的调用 fro... 阅读全文
posted @ 2019-01-02 15:13 飘零0 阅读(101) 评论(0) 推荐(0) 编辑
摘要:''' 函数:是一段可以重复调用的代码,通过输入的参数,返回对应的结果 名字绑定的机制,把实际参数的值与形式参数的值绑定到一起 1、函数调用的时候,实际参数的值的顺序与形式参数的顺序一一对应 2、当在函数调用的时候,指定了形式参数的实际参数,这个时候并不是一一对应,而是根据指定的值进行的 ''' def add(a,b): c=a+b print(c) print(a, b) a... 阅读全文
posted @ 2019-01-02 15:10 飘零0 阅读(264) 评论(0) 推荐(0) 编辑
摘要:一、注册 代码如下: 二、登陆 代码如下: 三、显示个人信息 代码如下: 四、主函数 代码如下: 五、执行 阅读全文
posted @ 2018-12-29 13:57 飘零0 阅读(1224) 评论(0) 推荐(0) 编辑
摘要:字符串、字典、元祖之间的相互转换: 1、字符串与列表之间的转换 结果: 2、列表与元祖之间的转换 结果: 3、字典与列表之间的转换 结果: 阅读全文
posted @ 2018-12-28 10:03 飘零0 阅读(1821) 评论(0) 推荐(0) 编辑
摘要:语法如下: 阅读全文
posted @ 2018-12-28 09:58 飘零0 阅读(604) 评论(0) 推荐(0) 编辑
摘要:常用如下所示: 阅读全文
posted @ 2018-12-28 09:57 飘零0 阅读(456) 评论(0) 推荐(0) 编辑
摘要:字符串常用的几种格式: 阅读全文
posted @ 2018-12-28 09:54 飘零0 阅读(334) 评论(0) 推荐(0) 编辑
摘要:对应的结果如下: 阅读全文
posted @ 2018-12-28 09:51 飘零0 阅读(985) 评论(0) 推荐(0) 编辑
摘要:很久没有写了,现在正式入职,准备好好干,加油! 我的第一个较正式的测试代码: 阅读全文
posted @ 2018-08-02 11:40 飘零0 阅读(1475) 评论(0) 推荐(0) 编辑
摘要:转自: http://www.testclass.net/list/python_list_1/ xUnit frameworks(单元测试框架) frameworks 框架 unittest - python自带的单元测试库,开箱即用 unittest2 - 加强版的单元测试框架,适用于Pytho 阅读全文
posted @ 2018-05-10 15:52 飘零0 阅读(301) 评论(0) 推荐(0) 编辑
摘要:import urllib.requestimport reimport osdef getHtml(url): page = urllib.request.urlopen(url) html = page.read() return htmldef getImg(html): imglist = 阅读全文
posted @ 2018-03-25 20:17 飘零0 阅读(177) 评论(0) 推荐(0) 编辑
摘要:服务端: import socketserver 阅读全文
posted @ 2018-03-18 20:02 飘零0 阅读(198) 评论(0) 推荐(0) 编辑
摘要:客户端: 阅读全文
posted @ 2018-03-18 17:31 飘零0 阅读(111) 评论(0) 推荐(0) 编辑
摘要:浅拷贝: A = [[1,2],3,4] B= A.copy() B[0][1] = 5 print(B,A) B = [[1,5],3,4] A = [[1,5],3,4] B[2]=6 A = [[1,2],3,4] B =[[1,2],3,6] 深拷贝: import copy A = [[1 阅读全文
posted @ 2018-01-21 13:41 飘零0 阅读(143) 评论(0) 推荐(0) 编辑
摘要:第一种方法: 阅读全文
posted @ 2017-11-29 18:45 飘零0 阅读(170) 评论(0) 推荐(0) 编辑
摘要:# _Author:huang# date: 2017/11/28# 字符串'''print("hello" * 3)print("hello world"[2:])print("llo" in "hello world")print(123 in [1232,123,345])print("Hua 阅读全文
posted @ 2017-11-28 17:01 飘零0 阅读(1474) 评论(0) 推荐(0) 编辑
摘要:# _Author:huang# date: 2017/11/26# 简单的购物车程序money = input("money:")product_list = [ ("Mac", 9000), ("Kindle", 300), ("Tesla", 8000), ("book", 60), ("bi 阅读全文
posted @ 2017-11-28 15:00 飘零0 阅读(287) 评论(0) 推荐(0) 编辑

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