随笔分类 -  python

上一页 1 ··· 30 31 32 33 34 35 36 37 38 ··· 48 下一页
摘要:1. 输出 阅读全文
posted @ 2019-01-29 12:21 anobscureretreat 阅读(240) 评论(0) 推荐(0)
摘要:from flask import Flask, jsonify from flask import abort from flask import make_response from flask import request from flask_httpauth import HTTPBasicAuth from flask import url_for auth = HTTPBasi... 阅读全文
posted @ 2019-01-29 11:49 anobscureretreat 阅读(271) 评论(0) 推荐(0)
摘要:经过搜索查找,发现错误原因是我在win7 x64的机器上装了64位的python IDLE,不能有效load32位的dll,换成32位的python就好了。 阅读全文
posted @ 2019-01-28 13:46 anobscureretreat 阅读(7854) 评论(0) 推荐(0)
摘要:LookupError: Couldn't find path to unrar library. 意思是找不到 unrar library的路径,这里我们就需要去下载这个unrar library,事实上它就是UnRAR.dll这个东西,下载网址:http://www.rarlab.com/rar 阅读全文
posted @ 2019-01-28 13:17 anobscureretreat 阅读(2143) 评论(0) 推荐(0)
摘要:import os import sys path = '"'+os.path.dirname(sys.executable)+'\\scripts\\pip" install --upgrade pip' os.system(path) 阅读全文
posted @ 2019-01-28 00:22 anobscureretreat 阅读(2078) 评论(0) 推荐(0)
摘要:axis合并方向 输出 join合并方式 输出 append添加数据 输出 Pandas合并merge 依据一组key合并 输出 依据两组key合并 输出 Indicator合并 输出 依据index合并 输出 阅读全文
posted @ 2019-01-25 15:26 anobscureretreat 阅读(200) 评论(0) 推荐(0)
摘要:#构造 输出: #切片选择指定行 输出 #通过行标记获取指定行(包含两端) 输出 #输出指定行指定列的数据 输出 #输出第三行第一列的数据 输出 #df.A 选择某列 输出 #进行切片选择,指定行,指定列 输出 #进行不连续筛选 输出 #筛选出df.A大于0的元素 布尔条件筛选 输出 #将df.A大 阅读全文
posted @ 2019-01-25 14:49 anobscureretreat 阅读(949) 评论(0) 推荐(0)
摘要:使用dropna()函数去掉NaN的行或列 输出: 使用fillna()函数替换NaN值 输出 使用isnull()函数判断数据是否丢失 输出 #判断数据中是否会存在NaN值 输出 阅读全文
posted @ 2019-01-25 14:30 anobscureretreat 阅读(1552) 评论(0) 推荐(0)
摘要:输出: 阅读全文
posted @ 2019-01-25 14:07 anobscureretreat 阅读(4435) 评论(0) 推荐(0)
摘要:1. 输出 2. 输出: 3. 输出 4. 输出 阅读全文
posted @ 2019-01-25 12:05 anobscureretreat 阅读(218) 评论(0) 推荐(0)
摘要:server client 阅读全文
posted @ 2019-01-24 23:47 anobscureretreat 阅读(158) 评论(0) 推荐(0)
摘要:输出 阅读全文
posted @ 2019-01-24 21:51 anobscureretreat 阅读(180) 评论(0) 推荐(0)
摘要:import time import threading def task_thread(counter): print(f'线程名称:{threading.current_thread().name} 参数:{counter} 开始时间:{time.strftime("%Y-%m-%d %H:%M:%S")}') num = counter while num: ... 阅读全文
posted @ 2019-01-24 21:08 anobscureretreat 阅读(177) 评论(0) 推荐(0)
摘要:输出 阅读全文
posted @ 2019-01-24 18:09 anobscureretreat 阅读(271) 评论(0) 推荐(0)
摘要:协程的概念 协程,又称微线程,纤程。英文名Coroutine。一句话说明什么是线程:协程是一种用户态的轻量级线程。(其实并没有说明白~) 我觉得单说协程,比较抽象,如果对线程有一定了解的话,应该就比较好理解了。 那么这么来理解协程比较容易: 线程是系统级别的,它们是由操作系统调度;协程是程序级别的, 阅读全文
posted @ 2019-01-24 17:14 anobscureretreat 阅读(255) 评论(0) 推荐(0)
摘要:server 输出: client 输出: 阅读全文
posted @ 2019-01-24 16:15 anobscureretreat 阅读(261) 评论(0) 推荐(0)
摘要:def str_to_hex(s): return ' '.join([hex(ord(c)).replace('0x', '') for c in s]) def hex_to_str(s): return ''.join([chr(i) for i in [int(b, 16) for b in s.split(' ')]]) def str_to_bin(s... 阅读全文
posted @ 2019-01-24 16:11 anobscureretreat 阅读(850) 评论(0) 推荐(0)
摘要:>>> x='123abc' >>> b=bin(int(x,16))[2:] >>> print(b) 100100011101010111100 阅读全文
posted @ 2019-01-24 16:09 anobscureretreat 阅读(16968) 评论(0) 推荐(3)
摘要:name = 'laogaoyang' # 采用系统默认编码格式 nameBytes = name.encode('utf-8') # 先将 name 解码(采用系统默认格式),然后用 'utf-8' 编码,最后格式为字节 nameStr = nameBytes.decode('utf-8') #将字节转为字符串 阅读全文
posted @ 2019-01-24 16:06 anobscureretreat 阅读(524) 评论(0) 推荐(0)
摘要:1. 字节数组 --> 十六进制字符串 >>> a = 'ab' >>> a.encode('hex') '6162' 2. 十六进制字符串 --> 字节数组 >>> b = '6162' >>> b.decode('hex') 'ab' 注意:十六进制字符串中只能包含0-9, a-f, A-F, 否则decode('hex')会执行失败 阅读全文
posted @ 2019-01-24 16:03 anobscureretreat 阅读(6559) 评论(0) 推荐(0)

上一页 1 ··· 30 31 32 33 34 35 36 37 38 ··· 48 下一页