上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 30 下一页
摘要: #_author:来童星#date:2019/12/15import os#1# print(os.name)# nt >windows操作系统#2 用于获取当前操作系统的换行符# print(os.linesep)# 为什么不显示# # 用于获取当前操作系统所使用的路径分隔符# print(os. 阅读全文
posted @ 2019-12-15 21:32 Stary_tx 阅读(237) 评论(0) 推荐(0) 编辑
摘要: #_author:来童星#date:2019/12/13from datetime import datetimeclass medicine: name='' price=0 PD='' Exp='' def __init__(self,name,price,PD,Exp): self.name= 阅读全文
posted @ 2019-12-13 17:46 Stary_tx 阅读(77) 评论(0) 推荐(0) 编辑
摘要: #_author:来童星#date:2019/12/12import geventimport timedef func1(): print('\033[31;1mfun1 starting...\033[0m',time.ctime()) gevent.sleep(2) print('\033[3 阅读全文
posted @ 2019-12-12 20:58 Stary_tx 阅读(442) 评论(0) 推荐(0) 编辑
摘要: #_author:来童星#date:2019/12/12from greenlet import greenletdef test1(): print(12) gr2.switch() print(34) gr2.switch()def test2(): print(56) gr1.switch() 阅读全文
posted @ 2019-12-12 20:56 Stary_tx 阅读(237) 评论(0) 推荐(0) 编辑
摘要: #_author:来童星#date:2019/12/12def consumer(name): print(" >start...") while True: new_baozi = yield print("[%s] is eating baozi %s" % (name, new_baozi)) 阅读全文
posted @ 2019-12-12 20:28 Stary_tx 阅读(191) 评论(0) 推荐(0) 编辑
摘要: #_author:来童星#date:2019/12/11#1.拼接字符串mon_en='Remerbrance is a form of meeting,Frgetfulness is a form of freedom 'mon_cn='记忆是一种相遇,遗忘是一种自由'print(mon_en+' 阅读全文
posted @ 2019-12-11 22:21 Stary_tx 阅读(205) 评论(0) 推荐(0) 编辑
摘要: #_author:来童星#date:2019/12/11#Pipefrom multiprocessing import Process, Pipedef f(conn): conn.send([42, None, 'hello']) conn.close()if __name__ == '__ma 阅读全文
posted @ 2019-12-11 22:17 Stary_tx 阅读(294) 评论(0) 推荐(0) 编辑
摘要: #_author:来童星#date:2019/12/11#Managersfrom multiprocessing import Process, Managerdef f(d, l,n): d[n] = '1' d['2'] = 2 d[0.25] = None l.append(n) print 阅读全文
posted @ 2019-12-11 21:54 Stary_tx 阅读(239) 评论(0) 推荐(0) 编辑
摘要: #_author:来童星#date:2019/12/11# 进程间通讯 # 不同进程间内存是不共享的,要想实现两个进程间的数据交换,可以用以下方法:# Queues# 使用方法跟threading里的queue类似:from multiprocessing import Process, Queue 阅读全文
posted @ 2019-12-11 21:46 Stary_tx 阅读(140) 评论(0) 推荐(0) 编辑
摘要: #_author:来童星#date:2019/12/10#1.year=[89,98,00,75,68,37,58,90]for index,value in enumerate(year): if str(value)!='0': year[index]=int('19'+str(value)) 阅读全文
posted @ 2019-12-10 17:17 Stary_tx 阅读(307) 评论(0) 推荐(0) 编辑
上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 30 下一页