摘要:
range和len这两个函数正好是方便迭代函数遍历的,不知道是不是故意设计成这样 如下程序中,range和len联合使用,刚好遍历列表a中所有元素 a=[1,2,3,4] for i in range(len(a)): print(a[i]) 程序输出 C:\work\python_program\ 阅读全文
摘要:
python3.6后加入了更加简洁的变量替换方式,f放在字符串外面,字符内加了大括号的变量会直接用变量值替换 f"{},{}" 程序如下 name = 'Guido' n = 37 print(f"{name} has {n} messages.") Guido has 37 messages. 阅读全文
摘要:
程序如下 from playwright.sync_api import sync_playwright with sync_playwright() as p: #browser = p.chromium.launch(channel="chrome",headless=False,slow_mo 阅读全文
摘要:
线程调用程序如下 import _thread import time def run(num): print(num) for i in range(10): _thread.start_new_thread(run,(i,)) #入参是调用的函数以及传给函数的参数(参数必须是元组,如果只有一个参 阅读全文
摘要:
代码如下 import time from appium import webdriver from appium.options.android import UiAutomator2Options from appium.webdriver.common.appiumby import Appi 阅读全文