摘要:
1. 下载安装iTerm2 ( https://iterm2.com/ ) 2. 打开iTerm2,执行命令 /bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)" 3. 下载如下两 阅读全文
摘要:
import win32clipboard from PIL import Image from io import BytesIO def copy_image_to_clipboard(img_path: str): '''输入文件名,执行后,将图片复制到剪切板''' image = Image 阅读全文
摘要:
import os.path from win32com.client import Dispatch excel = Dispatch("ket.Application") # 启动wps excel 应用。Microsoft excel用Excel.Application excel.Visib 阅读全文
摘要:
while(driver.execute_script("return document.readyState;") != "complete"): time.sleep(1) 阅读全文
摘要:
def is_chinese(uchar): """判断一个unicode是否是汉字""" if uchar >= u'\u4e00' and uchar <= u'\u9fa5': return True else: return False def is_number(uchar): """判断 阅读全文
摘要:
python——数据库操作PyMysql使用详解_南京丛林Jungle的博客-CSDN博客 阅读全文
摘要:
闭包。可以用来在一个函数,在一组私有变量之间,创建关联关系。在给定函数被调用的过程中,这些私有变量能够保持其持久性。(保存运行环境与变量的状态) func_list =[] for i in range(3): def deco(i): def myfunc(a): return i+a retur 阅读全文
摘要:
from xpinyin import Pinyin def get_pinyin(str): p = Pinyin() return ''.join([i.capitalize() for i in p.get_pinyin(str).split('-')]) print(get_pinyin(' 阅读全文
摘要:
鸭子类型 不用实现父类,只需要实现多个类,且多个类中实现了同一个方法(同名)。只关注方法名,不关注方法的实现方式。这种机制被称为鸭子类型。通过这个类型也可以实现多态。 案例: 比如list 和 set(), 他们都实现了iter(),所以实际都属于同一个类型:可迭代类型。 阅读全文