会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
丑矬穷屌
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
下一页
2021年2月17日
html笔记
摘要: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" http-equiv="refresh" content="2;URL=http://www.baidu.com"> <!--定义网页源信息,2秒后跳转页面--> <meta
阅读全文
posted @ 2021-02-17 13:37 丑矬穷屌
阅读(53)
评论(0)
推荐(0)
2021年2月15日
pymysql
摘要: import pymysql conn=pymysql.connect( host='127.0.0.1', port=3306, user='root', password='999', database='day14', charset='utf8', autocommit=1 #自动提交,不设
阅读全文
posted @ 2021-02-15 22:35 丑矬穷屌
阅读(71)
评论(0)
推荐(0)
2021年2月2日
gevent
摘要: from gevent import monkey;monkey.patch_all()import timefrom gevent import spawndef pp(): print('ppstar') time.sleep(2) print('ppover')def oo(): print(
阅读全文
posted @ 2021-02-02 18:27 丑矬穷屌
阅读(72)
评论(0)
推荐(0)
event
摘要: from threading import Thread,Eventimport timeevent=Event()def wait(): print('wait==') time.sleep(2) print('over!') event.set()def go(i): print(f'{i},Z
阅读全文
posted @ 2021-02-02 18:02 丑矬穷屌
阅读(219)
评论(0)
推荐(0)
semaphore信号量
摘要: from threading import Thread,Semaphore #类似锁的一个东西import timelock_num=Semaphore(2) #设置锁的数量def test(name): lock_num.acquire() print(f'{name}已加入') time.sl
阅读全文
posted @ 2021-02-02 17:52 丑矬穷屌
阅读(76)
评论(0)
推荐(0)
thread/process pool
摘要: from concurrent.futures import ThreadPoolExecutor,ProcessPoolExecutorimport timedef func(i): print('star', i) time.sleep(2) return f'over,{i}'def cb(r
阅读全文
posted @ 2021-02-02 12:27 丑矬穷屌
阅读(82)
评论(0)
推荐(0)
2021年2月1日
thread_socket
摘要: import socketfrom threading import Threadserver = socket.socket(socket.AF_INET,socket.SOCK_STREAM)server.bind(('127.0.0.1',8080))server.listen(5)# def
阅读全文
posted @ 2021-02-01 00:22 丑矬穷屌
阅读(85)
评论(0)
推荐(0)
2021年1月31日
Joinablequeue
摘要: from multiprocessing import Process,JoinableQueueimport randomimport timedef fang(jq,ll): for i in range(3): ran=random.randint(1,3) name=random.choic
阅读全文
posted @ 2021-01-31 21:47 丑矬穷屌
阅读(131)
评论(0)
推荐(0)
Queue之间存取数据
摘要: from multiprocessing import Queue,Processdef fang(queue): queue.put('你愁啥')def qu(queue): print(queue.get())if __name__ == '__main__': q=Queue() p_fang
阅读全文
posted @ 2021-01-31 20:51 丑矬穷屌
阅读(91)
评论(0)
推荐(0)
Queue
摘要: from multiprocessing import Queueq = Queue(3)q.put('aaa')q.put('bbb')q.put('ccc')print(q.full()) #判断当前队列是否已满print(q.empty()) #判断队列是否为空a = q.get()b = q
阅读全文
posted @ 2021-01-31 20:38 丑矬穷屌
阅读(47)
评论(0)
推荐(0)
上一页
1
2
3
下一页
公告