11 2018 档案

python 将一个字符list的列表扁平化成了一个list
摘要:a=[['app','ap','ade'],['er'],['bcc','brt']] 将这么一个list 转换成 a2=['app','ap','ade','er','bcc','brt'] 做法:a2=[x for tup in a for x in tup] 阅读全文

posted @ 2018-11-27 16:58 砌墙的石头 阅读(1580) 评论(0) 推荐(1)

python 参数命名的坑
摘要:在处理一批数据时,时间参数命名为如下红体字这样带下划线的格式, def get_data(dt_start,dt_end): with execute_sql() as getData: s = f"select * into temp_new.dbo.online_临时表 from (select 阅读全文

posted @ 2018-11-22 14:21 砌墙的石头 阅读(518) 评论(0) 推荐(0)

python 函数记录
摘要:1.time.sleep(t) time.sleep(t)函数推迟调用线程的运行,可通过参数 t 指定秒数,表示进程挂起的时间。 2.lock = threading.RLock()和lock = threading.Lock() 锁有两种状态:被锁(locked)和没有被锁(unlocked)。拥 阅读全文

posted @ 2018-11-19 10:24 砌墙的石头 阅读(488) 评论(0) 推荐(0)

python range()函数
摘要:for i in range ()作用: range()是一个函数, for i in range () 就是给i赋值: 比如 for i in range (1,3): 就是把1,2依次赋值给 i 举个例子:range(3)即:从1到3,不包含3,即0,1,2 range(1,3) 即:从1到3, 阅读全文

posted @ 2018-11-19 09:54 砌墙的石头 阅读(18277) 评论(0) 推荐(0)

导航