随笔分类 - Python模块
介绍python模块的用法
摘要:print() 注:此语法适用于Python 3.x 作用: 在屏幕输出(打印)内容 必要操作: 内置函数,无需import方式导入 帮助查看: >>> help(print) 方法(函数): ## Python 2.x 和3.x 通用打印方法 >>> print("要打印的内容。") ## 定义变
阅读全文
摘要:clint 作用: 进度条 必要操作: >>> from clint.textui import progress 帮助查看: >>> help(clint) 或 单独查看某个方法(函数) >>> help(clint.textui) 方法(函数): for ch in progress.bar(r
阅读全文
摘要:tqdm 作用: 进度条 必要操作: >>> import tqdm 帮助查看:>>> help(tqdm) 方法(函数): for data in tqdm(response.iter_content()): handle.write(data) 参考: https://www.cnblogs.c
阅读全文
摘要:requests - 请求HTTP库 常用网络请求速查表:https://www.cnblogs.com/wutou/p/15802687.html 来源:https://www.52pojie.cn/thread-1551640-1-1.html TIF格式,原图下载:https://wwa.la
阅读全文
摘要:xlutils 作用: Eecel文件操作 必要操作: import xlutils 帮助查看: >>> help(xlutils) 或 单独查看某个方法(函数) >>> help(xlutils.copy) 方法(函数): ## 复制excel文件里所有sheet页内容到内存 workbook =
阅读全文
摘要:xlwt 作用: Excel写入文件操作 必要操作: import xlwt 帮助查看: >>> help(xlwt) 或 单独查看某个方法(函数) >>> help(xlwt.write) 方法(函数): row = 0 #行 column = 9 # 列 xlwt.write(row,colum
阅读全文
摘要:xlrd 作用: Excle内容读取 必要操作: import xlrd 帮助查看: >>> help(xlrd) 或 单独查看某个方法(函数) >>> help(xlrd.open_workbook) 方法(函数): ## 打开test.xls文件 wb = xlrd.open_workbook(
阅读全文
摘要:作用: 正则表达式 必要操作: >>> import re 帮助查看: >>> help(re) 或 单独查看某个方法(函数) >>> help(re.sub) 方法(函数): >>> re.match('[0-9]+.[0-9]+', compute_capability)
阅读全文
摘要:itertools 作用: 用于创建和使用迭代器的函数工具 必要操作: >>> import itertools 帮助查看: >>> help(itertools) 方法(函数): ## 生成8为数 >>> itertools.product(lowercase+digits,repeat=8) i
阅读全文
摘要:os 作用: 系统操作 必要操作: >>> import os 帮助查看: >>> help(os) 或 单独查看某个方法(函数) >>> help(os.remove) 方法(函数): ## 删除 china.txt 文件 >>> outfile = "china.txt" >>> os.remo
阅读全文
摘要:Python官方标准库(英文): https://docs.python.org/2/library/index.html https://docs.python.org/3/library/index.html Python官方标准库(中文): https://docs.python.org/zh
阅读全文
摘要:pyperclip 作用: 复制内容 必要操作: >>> import pyperclip 帮助查看: >>> help(pyperclip) 或 单独查看某个方法(函数) >>> help(pyperclip.copy) 方法(函数): ## 复制内容 class SendMsg(object):
阅读全文
摘要:作用: 模拟按下键盘 必要操作: >>> import pyautogui 帮助查看: >>> help(pyautogui) 或 单独查看某个方法(函数) >>> help(pyautogui.hotkey) 方法(函数): ## 模拟按下键盘组合键 ctrl+alt+w >>> pyautogu
阅读全文
摘要:time 作用: 提供时间操作 必要操作: >>> import time 帮助查看: >>> help(time) 或 单独查看某个方法(函数) >>> help(time.clock) 方法(函数): ## 等待1秒 >>> time.sleep(1) >>> ## 返回自进程开始或首次调用cl
阅读全文
摘要:platform 作用: 获取平台信息 必要操作: >>> import platform ## 导入包 帮助查看: >>> help(platform) 或 单独查看某个方法(函数) >>> help(platform.node) 方法(函数): ## 获取计算机名 >>> platform.no
阅读全文
摘要:官方链接:3.10内置函数 https://docs.python.org/zh-cn/3/library/functions.html 内置函数 Python 解释器内置了很多函数和类型,任何时候都能使用。以下按字母顺序给出列表。 内置函数 A abs() aiter() all() any()
阅读全文