摘要:
GIL是什么 首先需要明确的一点是GIL并不是Python的特性,它是在实现Python解析器(CPython)时所引入的一个概念。就好比C++是一套语言(语法)标准,但是可以用不同的编译器来编译成可执行代码。有名的编译器例如GCC,INTEL C++,Visual C++等。Python也一样,同 阅读全文
摘要:
# Author:Zhu Jin Xinimport randomcheckcode = ""for i in range(4): current = random.randrange(0,4) if i==current: tmp = chr(random.randint(65,90)) chec 阅读全文
摘要:
import mathf = 29.4print(math.ceil(f)) #向上取整print(math.floor(f)) #向下取整print(round(f)) #四舍五入输出302929 阅读全文
摘要:
from functools import reducedef func (x,y): return x+yprint(reduce(func,range(101)))print(reduce(lambda x, y: x+y, range(101))) 阅读全文
摘要:
import timedef bar():time.sleep(3)print('in the bar')def test1(func):start_time=time.time()func() #run barstop_time=time.time()print("the func run tim 阅读全文
摘要:
# Author:Zhu Jin Xinproduct_list =[ ("Airpos",1200), ("Beats",2500), ("Iphone7",4800), ("Iphone8",5800), ("IphoneX",9800), ("IphoneXS",10800)]shopping 阅读全文