摘要:
random 是一个产生随机数的模块,常见用法如下: random.randint():用于随机产生指定范围的整数,如 random.randint(1, 10) 表示产生 1-10 之间的整数,包括 1 和 10 阅读全文
摘要:
线程间使用队列来互相交换数据,数据可以是字符串 、列表 、元组等,Queue 是提供队列操作的模块,常见的队列如下: FIFO:First In First Out 先进先出队列,也就是最先放进去的数据,会被先拿出来,可以用 Queue.Queue() 来实现LIFO:Last In First O 阅读全文
摘要:
salt-run 常见用法如下: 阅读全文
摘要:
threading 常见用法: (1) 在 thread 中,我们是通过 thread.start_new_thread(function, args) 来开启一个线程,接收一个函数和该函数的参数,函数的参数必须是元组的形式(2) 在 threading 中,我们是通过 threading.Thre 阅读全文