摘要:
Python控制exce 关于包的说明: xlrd 读取excel文件, xlrd >= 2.0时,仅支持xls格式; 指定 xlrd 版本 1.2.0 可支持xlsx xlwt 写入excel文件,仅支持xls格式。推荐使用 适合与xlrd配合读取和修改excel文件,也可以直接创建新excel文 阅读全文
摘要:
# -*- coding: utf-8 -*- list1 = [1, 2, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5] list2 = [5, 5, 6, 7, 8, 9] # set集合 # 差集--两种情况 print(list(set(list1) - set(list2)) 阅读全文
摘要:
1. apt get install 适用于Ubuntu系统,不适用于mac os 2. mac os安装包的命令应该是brew 阅读全文
摘要:
import os from multiprocessing import Pool demo = 'this is a test' def func(): with open('text.txt', 'w') as f: f.write(demo) print('process {} write 阅读全文
摘要:
```https://blog.csdn.net/cpongo3/article/details/88819885``` 阅读全文
摘要:
``` # -*- coding: utf-8 -*- ''' @File : test.py @Author: qiguagnhui @Date : 2020-04-11 23:17 @Desc : ''' import os import sys savedStdout = sys.stdout #保存标准输出流 with open('out.txt', 'w') as file: sys.s 阅读全文
摘要:
# -*- encoding=utf-8 -*- from itertools import combinations,permutations test_data = {'a', 'b', 'c'} # 排列 -- 关注排列方式 print('排列有:{}'.format(list(permuta 阅读全文
摘要:
``` # 第一种: number = 11223344556677889900 # 反转1,reverse()方法 # list1 = list(str(number)) # list1.reverse() # 反转2, 切片 list1 = list(str(number))[::-1] print('反转后的', list1) # 删除 # 删除1, 直接remove元素 list1.rem 阅读全文
摘要:
``` # -*- coding: utf-8 -*- import cv2 # 读取图片 img = cv2.imread('phone.png') # h、w为想要截取的图片大小 h = 35 w = 170 x = 500 y = 425 cropImg = img[(y):(y + h), (x):(x + w)] cv2.imwrite('test.png', cropImg) ``` 阅读全文
摘要:
``` # -*- coding: utf-8 -*- # 获取server运行情况 # import json # from datetime import datetime # # import paramiko # import xlwt, xlrd # from xlutils.copy import copy # # def get_host_cpu_memory(): # client 阅读全文