上一页 1 ··· 3 4 5 6 7 8 9 10 下一页
  2021年3月5日
摘要: 一、 非阻塞状态: import socketfrom builtins import print, Exceptionimport timesk = socket.socket()address = ('127.0.0.1',8000)sk.bind(address)sk.listen(3)#设置 阅读全文
posted @ 2021-03-05 15:01 bruce.sharp 阅读(43) 评论(0) 推荐(0)
  2021年3月4日
摘要: 1、在安装的目录下创建data目录 2、进入安装后的mysql中的bin目录下: 3、mysqld --initialize-insecure 进行数据库的初始化(创建root用户,密码为空) 4、运行mysqld 启动mysql服务 执行命令出错时,可能时cmd要以管理员身份运行的原因 阅读全文
posted @ 2021-03-04 17:52 bruce.sharp 阅读(68) 评论(0) 推荐(0)
  2021年3月3日
摘要: 阅读全文
posted @ 2021-03-03 16:29 bruce.sharp 阅读(44) 评论(0) 推荐(0)
摘要: 一、生成器例子 def f(): print('你好') name = yield 44 print(name) yield 55g = f()next(g)print(g.send('zhou')) 二、 from builtins import print, next, rangedef con 阅读全文
posted @ 2021-03-03 10:44 bruce.sharp 阅读(566) 评论(0) 推荐(0)
  2021年3月1日
摘要: 一、python2解释器默认是ascii码 python3解释器默认是utf8编码 print ‘测试’ 时python2是byte类型所以会报错 阅读全文
posted @ 2021-03-01 16:49 bruce.sharp 阅读(57) 评论(0) 推荐(0)
摘要: 一、创建进程 from builtins import print, range, superfrom multiprocessing.context import Processimport timedef f(name): time.sleep(1) print('hello', name, t 阅读全文
posted @ 2021-03-01 15:27 bruce.sharp 阅读(83) 评论(0) 推荐(0)
  2021年2月23日
摘要: 一、简单的创建线程 def foo(n): print(n) sleep(1)t1 = threading.Thread(target=foo,args=(1,))t1.start() 二、GIL >全局解释器锁 就是因为有GIL的原因 所以python解释器才只能处理一个线程 所以python真正 阅读全文
posted @ 2021-02-23 10:26 bruce.sharp 阅读(108) 评论(0) 推荐(0)
  2021年2月19日
摘要: 一、 SOCK_STREAM:TCP SOCK_Dgram :UDP family = AF_INET family=AF_UNIX eg: server: import socketfrom builtins import print, bytes, strsk = socket.socket() 阅读全文
posted @ 2021-02-19 10:58 bruce.sharp 阅读(58) 评论(0) 推荐(0)
  2021年1月29日
摘要: 格式时间==》时间戳time.mktime(time.strptime(account_data['expire_data'],'%Y-%m-%d'))格式时间==》结构时间>>> time.strptime('2020-01-01','%Y-%m-%d')time.struct_time(tm_y 阅读全文
posted @ 2021-01-29 16:53 bruce.sharp 阅读(59) 评论(0) 推荐(0)
  2021年1月28日
摘要: json:(序列化一般的数据类型) import jsonfrom builtins import *dic = {'name':'alex','age':'18'}data = json.dumps(dic)f = open('jsontest','w')f.write(data)f.close( 阅读全文
posted @ 2021-01-28 16:05 bruce.sharp 阅读(53) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 下一页