要一直走下去

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2022年5月19日

摘要: zipfile压缩文件。包括空目录 # !/usr/bin/python import os import zipfile def zipdir(dirPath=None, zipFilePath=None, includeDirInZip=True): if not zipFilePath: zi 阅读全文
posted @ 2022-05-19 23:11 要一直走下去 阅读(407) 评论(0) 推荐(0) 编辑

2021年10月31日

摘要: select * from A where id in(select id from B) 有两点区别: (1) 使用上的区别:exists中放一个子查询有记录返回true,无记录返回false(NULL也算有记录),in中查询结果集只能有一个字段 (2) 性能上的区别:in要把缓存到内存中,exi 阅读全文
posted @ 2021-10-31 22:41 要一直走下去 阅读(3256) 评论(2) 推荐(1) 编辑

2021年10月20日

摘要: 登录--异步发请求--退出 import asyncio import aiohttp async def GET_CAPTCHA_JPG(session): """ 获取验证码图片,并保存在本地 """ async with session.get(url="http://192.168.112. 阅读全文
posted @ 2021-10-20 10:44 要一直走下去 阅读(166) 评论(0) 推荐(0) 编辑

2021年10月19日

摘要: 说明:需要Python 3.7+ 1、并发运行两个coroutine,写法一: 用Task import asyncio import time async def say_after(delay, what): await asyncio.sleep(delay) print(what) asyn 阅读全文
posted @ 2021-10-19 15:55 要一直走下去 阅读(293) 评论(0) 推荐(0) 编辑

2021年10月18日

摘要: 1、使用yield i def my_generator(n): for i in range(n): temp = yield i print(f'我是{temp}') g = my_generator(5) print(next(g)) # 输出0 print(next(g)) # 输出1 pr 阅读全文
posted @ 2021-10-18 17:07 要一直走下去 阅读(57) 评论(0) 推荐(0) 编辑

摘要: 生成器&迭代器 生成器的特性1、生成器是一个有yield关键字的函数对象,yield暂停并保存并返回调用结果2、第一次通过next开始运行这个函数,以后每次next就从yield开始继续运行函数3、可以用send给生成器的yield关键字传值并激活函数 ''' 生成器:循环n次找出第n个元素 可以由 阅读全文
posted @ 2021-10-18 11:09 要一直走下去 阅读(10) 评论(0) 推荐(0) 编辑

2021年9月29日

摘要: count(字段)不会取Null的 select count(*) from test01 7条 select count(0) from test01 7条 select count(a) from test01 7条 select count(b) from test01 6条 阅读全文
posted @ 2021-09-29 11:23 要一直走下去 阅读(180) 评论(0) 推荐(0) 编辑

2021年8月31日

摘要: select t1.* from coal_installed_capacity t1where NOT EXISTS (select * from coal_installed_capacity t2 where t2.company_name = t1.company_name and left 阅读全文
posted @ 2021-08-31 14:00 要一直走下去 阅读(2273) 评论(0) 推荐(0) 编辑

2021年5月31日

摘要: dynamic.py import unittest class MakeTestCases: testcases = None def make_test_func(self, case=None): def func(*args, **kwargs): self = args[0] self.a 阅读全文
posted @ 2021-05-31 22:24 要一直走下去 阅读(384) 评论(0) 推荐(0) 编辑

摘要: self.wrap_driver.move_to_element(locator=const_xpath.monitor_select) #鼠标移动到某个区域target = self.driver.find_element_by_xpath(const_xpath.insurance[1]) #下 阅读全文
posted @ 2021-05-31 14:38 要一直走下去 阅读(1567) 评论(0) 推荐(0) 编辑