随笔分类 -  python——自动化——常用技能

摘要:学习一下python的日志模块logging,可以参考如下博客,写得很详细 https://www.cnblogs.com/yyds/p/6901864.html https://www.cnblogs.com/goodhacker/p/3355660.html https://cuiqingcai 阅读全文
posted @ 2020-03-04 23:38 小白龙白龙马
摘要:转载:https://www.jianshu.com/p/e5595fd9f0e8 3、日志流处理流程 logging日志模块四大组件 组件名称对应类名功能描述 日志器 Logger 提供了应用程序可一直使用的接口 处理器 Handler 将logger创建的日志记录发送到合适的目的输出 过滤器 F 阅读全文
posted @ 2020-03-04 23:34 小白龙白龙马
摘要:python官网:https://docs.python.org/3.5/howto/logging-cookbook.html 转载:https://www.cnblogs.com/CJOKER/p/8295272.html 用Python写代码的时候,在想看的地方写个print xx 就能在控制 阅读全文
posted @ 2020-03-04 23:32 小白龙白龙马
摘要:import logging logging.debug("debug message") #告警级别最低,只有在诊断问题时才有兴趣的详细信息。 logging.info("info message") #告警级别比debug要高,确认事情按预期进行。 logging.warning("warnin 阅读全文
posted @ 2020-03-04 23:14 小白龙白龙马
该文被密码保护。
posted @ 2020-03-03 12:14 小白龙白龙马
摘要:转载:https://blog.csdn.net/auto_mind/article/details/87747206?depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none 阅读全文
posted @ 2020-03-03 11:40 小白龙白龙马
该文被密码保护。
posted @ 2020-03-03 11:32 小白龙白龙马
该文被密码保护。
posted @ 2020-03-02 03:19 小白龙白龙马
摘要:import csvexampleFile = open('C:\\Users\\del\\Desktop\\123.csv')xr = csv.reader(exampleFile)user = []for x in xr: if xr.line_num == 1: continue print( 阅读全文
posted @ 2020-03-01 03:38 小白龙白龙马
摘要:转载:https://automatetheboringstuff.com/2e/chapter16/ import csv exampleFile = open('C:\\Users\\del\\Desktop\\123.csv') exampleReader = csv.reader(examp 阅读全文
posted @ 2020-03-01 03:03 小白龙白龙马
摘要:import openpyxlwb = openpyxl.load_workbook('C:\\Users\\del\\Desktop\\温职.xlsx')ws1=wb.create_sheet('china',0)# ws1['A1'] = 'juankuan'ws1['E1'] = '中国'ws 阅读全文
posted @ 2020-03-01 01:52 小白龙白龙马
摘要:from openpyxl import Workbook wb=Workbook() #创建一个工作表 ws=wb.active #ws操作sheet页 ws1=wb.create_sheet('Mysheetfirst',0) # ws1['A1'] = 'juankuan' ws1['E1'] 阅读全文
posted @ 2020-03-01 01:47 小白龙白龙马
摘要:import openpyxl import datetime # wb = openpyxl.load_workbook('C:\\Users\\del\\Desktop\\温职.xlsx') print(type(wb)) #<class 'openpyxl.workbook.workbook. 阅读全文
posted @ 2020-03-01 01:18 小白龙白龙马
摘要:import openpyxl # wb = openpyxl.load_workbook('C:\\Users\\del\\Desktop\\温职.xlsx') print(type(wb)) #<class 'openpyxl.workbook.workbook.Workbook'> 返回一个w 阅读全文
posted @ 2020-03-01 01:01 小白龙白龙马
摘要:转载:https://www.cnblogs.com/dachenzi/p/8488460.html openpyxl模块介绍 openpyxl模块是一个读写Excel 2010文档的Python库,如果要处理更早格式的Excel文档,需要用到额外的库,openpyxl是一个比较综合的工具,能够同时 阅读全文
posted @ 2020-02-29 23:52 小白龙白龙马
摘要:转载:https://automatetheboringstuff.com/ 转载:https://automatetheboringstuff.com/2e/chapter10/ import os for folderName, subfolders, filenames in os.walk( 阅读全文
posted @ 2020-02-28 23:39 小白龙白龙马
摘要:import zipfile import os print(os.getcwd()) #C:\Users\del\PycharmProjects\untitled1\cs newZip = zipfile.ZipFile('C:\\Users\\del\\Desktop\\新建文件夹 (2)\\新 阅读全文
posted @ 2020-02-28 23:19 小白龙白龙马
摘要:全部解压缩到指定路径里: import zipfile import os print(os.getcwd()) #C:\Users\del\PycharmProjects\untitled1\cs exampleZip = zipfile.ZipFile('C:\\Users\\del\\Desk 阅读全文
posted @ 2020-02-28 23:07 小白龙白龙马
摘要:import zipfileexampleZip = zipfile.ZipFile('C:\\Users\\del\\Desktop\\新建文件夹 (2)\\新建文件夹 (2).zip')for zip_file in exampleZip.namelist(): try: zip_file = 阅读全文
posted @ 2020-02-28 22:50 小白龙白龙马
摘要:x = '111,222,333,444\n' print(x) users = [ ] print(x[:-1]) print(' ') print(x[:-1].split(',')) print(' ') for line in x[:-1].split(','): print(line) u 阅读全文
posted @ 2020-02-28 09:15 小白龙白龙马