上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 34 下一页
摘要: 三、字典和集合 可散列类型:如果一个对象是可散列的,那么在这个对象的生命周期中,它的散列值是不变的。而且这个对象需要实现__hash__() 方法,还要有 __qe__() 方法,这样才能与其他键作比较。如果两个可散列对象是相等的,那么它们的散列值一定是一样的。 In [103]: a = (1,2 阅读全文
posted @ 2021-08-16 14:25 pythoner_wl 阅读(95) 评论(0) 推荐(0) 编辑
摘要: 对于\xa0的处理 在用Python3处理英文文档时遇到split(' ')无法分开的空格,使用encode('utf8')编码后发现它并不是空格,而是\xa0,它其实是latin1编码字符,为了使\xa0像空格那样分开字符,可以直接调用split()即可 前端传输的参数值中有空格,结果是 lati 阅读全文
posted @ 2021-08-16 11:25 pythoner_wl 阅读(1198) 评论(0) 推荐(0) 编辑
摘要: 当 转义字符串 是从文件读取或爬虫等其他地方读到时,你发现转义字符失效了,不能起到原来的作用了,不相等了。因为:这不是你程序中定义的语句。 反转义:让 不生效的转义字符 生效。 def get_unicode_escape_str(self, command_str): """反转义处理""" re 阅读全文
posted @ 2021-08-12 11:29 pythoner_wl 阅读(78) 评论(0) 推荐(0) 编辑
摘要: def create(self, request, *args, **kwargs): container_type_list = settings.CONTAINER_TYPE_LIST gas_file = request.data.get('gas_file') if gas_file: "" 阅读全文
posted @ 2021-08-09 18:31 pythoner_wl 阅读(407) 评论(0) 推荐(0) 编辑
摘要: from io import BytesIO from django.utils.encoding import escape_uri_path bytes_file = BytesIO() f.write(bytes_file) bytes_file.seek(0) file_name = "订单 阅读全文
posted @ 2021-08-06 18:37 pythoner_wl 阅读(596) 评论(0) 推荐(0) 编辑
摘要: Python之IO模块的使用 1.StringIO的使用 # 类似文件的缓冲区 from io import StringIO cache_file = StringIO() print(cache_file.write('hello world')) # 11 print(cache_file.s 阅读全文
posted @ 2021-08-06 14:36 pythoner_wl 阅读(118) 评论(0) 推荐(0) 编辑
摘要: dbconn=pymysql.connect( host="rm-.mysql.rds.aliyuncs.com", database="nde", user="linr", password="deai$", port=3306, charset='utf8' ) uids = ['eTRxekV 阅读全文
posted @ 2021-08-05 14:35 pythoner_wl 阅读(895) 评论(0) 推荐(0) 编辑
摘要: import xlwt import pandas as pd class Excel_style: """excel表格样式类""" def __init__(self, font_heigh): self.font_heigh = font_heigh # 字体大小:磅 @property de 阅读全文
posted @ 2021-08-05 14:01 pythoner_wl 阅读(1375) 评论(0) 推荐(0) 编辑
摘要: 【Bug】ValueError: row index was 65536, not allowed by .xls format 行数达到上限,改成 to_csv ValueError: row index was 5, not allowed by .xls format 发现 5 根本不是行数上 阅读全文
posted @ 2021-08-05 13:57 pythoner_wl 阅读(372) 评论(0) 推荐(0) 编辑
摘要: "0AH"是换行 \n,“0DH"是回车 \r '\r'是回车,前者使光标到行首,(carriage return) '\n'是换行,后者使光标下移一格,(line feed) \r 是回车,return \n 是换行,newline 阅读全文
posted @ 2021-07-28 17:27 pythoner_wl 阅读(1089) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 34 下一页