![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
jayed008
这个作者很懒,什么都没留下…
展开
-
20011701python函数嵌套
1、装饰器 from functools import wraps import datetime def logging(func): @wraps(func) def wrapper(*args, **kwargs): """print log before a function.""" print('[DEBUG] {}: enter ...原创 2020-01-17 16:24:42 · 100 阅读 · 0 评论 -
19082801python常见内建模块
1、time >>> now = time.time() # 当前时间 float类型 >>> time.strftime("%Y-%m-%d %H:%M:%S") #当前时间 str '2016-11-04 15:29:58' >>> time.ctime() # 当前时间 english str 'Fri Nov 4 ...原创 2019-08-28 17:11:32 · 130 阅读 · 1 评论 -
19091801threading线程run()和start()
start() import threading import time def worker(): count = 1 while True: if count >= 6: break time.sleep(1) count += 1 print("thread name = {...转载 2019-09-18 11:07:05 · 791 阅读 · 0 评论 -
19091802使用subprocess
目录 subprocess.call() subprocess.check_out() subprocess.check_output() subprocess.Popen() subprocess.call() res = subprocess.call('ls -l', shell = True) print 'res:', res subprocess.chec...原创 2019-09-18 15:28:50 · 86 阅读 · 0 评论 -
19092501es scroll-scan的python滚动翻页
from elasticsearch import Elasticsearch es = Elasticsearch([ 'http://conf:9200/' ]) page = es.search( index ='ware_index', doc_type ='ware_type', scroll ='2m', search_type...原创 2019-09-25 20:31:46 · 260 阅读 · 0 评论