03 2023 档案
摘要:1. 检测工具 https://regex101.com/ 这个不要钱 https://www.regexbuddy.com/download.html 需要钱钱买license 是真的好用 2. 单字符匹配 . 匹配任意一个字符(除了\n) [] 匹配[]内列举的字符 \d 匹配数字0-9 \D
阅读全文
摘要:import urllib.request import gevent from gevent import monkey monkey.patch_all() def main(): urlList = ['http://10.194.116.146/CSSImg/hkjc_logo.png',
阅读全文
摘要:我在很久之前写过一次,也都是从网上搬运的知识,这段时间一直在学python,其他的知识就会有遗忘,我再复习一遍。 一. 反射的基本概念 使用反射机制可以构造类对象,动态获取当前class的信息 比如方法的信息、注解信息、方法的参数、属性等; 二. 实现反射相关的类库 java.lang.reflec
阅读全文
摘要:1. 概念(绕口) 进程: 进程是具有一定独立功能的程序关于某个数据集合上的一次运行活动,进程是系统进程资源分配和调度的一个独立单位。每个进程都有自己的独立空间,不同进程通过进程间通信来通信。由于进程比较重量,占据独立内存,所以上下文进程间的切换开销(队列,栈,寄存器‘虚拟内存,文件句柄等)比较大,
阅读全文
摘要:gevent 也是第三方库,自行调度协程,自动试别程序的耗时操作。比如读文件,等待时间。 代码举了个栗子 from gevent import monkey monkey.patch_all() import time import gevent def work1(): while True: p
阅读全文
摘要:1. greenlet 自行执行的微线程 https://greenlet.readthedocs.io/en/latest/greenlet.html 2. 终端安装 pip install greenlet 3. 举个栗子 import time from greenlet import gre
阅读全文
摘要:1.协程定义 不开辟新的线程的基础上,实现多个任务,是个特殊的生成器。一秒钟能切换上百次。 2.原始版协程 import time #1.work1 生成器 def work1(): while True: print("executing work1......") yield time.slee
阅读全文
摘要:1. 配置内网 确认能登录 https://deopcard.corp.OOOO.com/ui/builds Artifacts>set me up>search: pypi> Get the info as below in resolve tab 在这个文件夹路径下 :Users->userna
阅读全文
摘要:1. 接口 Request URL: http://10.194.109.125/UserHabit/ICSUI/QuickLogin Request Method: POST Status Code: 204 No Content 2. feature 文件 Feature: API test S
阅读全文
摘要:1. 测试接口 Request URL: http://10.194.109.125/EnvironmentMonitor/ICSQuickLogin Request Method: GET Status Code: 200 OK 2. Test Runner 文件 package APITestC
阅读全文
摘要:import json def print_hi(name): print(f'Hi, {name}') if __name__ == '__main__': print_hi('PyCharm') updateValue = 12345 with open('jsonfile/create_msp
阅读全文
摘要:class Fabonacci(object): def __init__(self, num): #fabonni number self.num = num self.a = 1 self.b = 1 self.current_index = 0 # __iter__ def __iter__(
阅读全文