摘要: 1 from PIL import Image,ImageFont,ImageDraw,ImageFilter 2 import random 3 import string 4 import sys 5 import math 6 7 numbers=4 8 size=(150,60) 9 bgc 阅读全文
posted @ 2020-06-09 20:33 马蹄哒哒 阅读(266) 评论(0) 推荐(0)
摘要: 1 import os 2 3 os.system('notepad') #打开记事本 4 5 os.system('shutdown -s -t 20') #20秒钟以后关机 6 7 os.system('shutdown -a') #取消关机 8 9 os.getcwd() #获取当前的绝对路径 阅读全文
posted @ 2020-06-09 20:31 马蹄哒哒 阅读(170) 评论(0) 推荐(0)
摘要: 1 from aip import AipOcr 2 3 """ 你的 APPID AK SK """ 4 APP_ID = 5 API_KEY = 6 SECRET_KEY = 7 8 client = AipOcr(APP_ID, API_KEY, SECRET_KEY) 9 """ 读取图片 阅读全文
posted @ 2020-06-09 20:28 马蹄哒哒 阅读(467) 评论(0) 推荐(0)
摘要: 1 from aip import AipSpeech 2 import pygame #两个都可以用来播放 3 """ 你的 APPID AK SK """ 4 5 APP_ID = '' 6 API_KEY = '' 7 SECRET_KEY = '' 8 9 client = AipSpeec 阅读全文
posted @ 2020-06-09 20:27 马蹄哒哒 阅读(179) 评论(0) 推荐(0)
摘要: 1 import pdfplumber 2 3 pdf=pdfplumber.open(',,,,,,,.pdf') 4 5 first_page=pdf.pages[0] 6 7 print(first_page.extract_text()) #打印第一页内容 8 9 10 11 #提取其中的表 阅读全文
posted @ 2020-06-09 20:25 马蹄哒哒 阅读(332) 评论(0) 推荐(0)
摘要: 1 from pptx import Presentation 2 3 prs=Presentation('名字.pptx') 4 5 for slide in prs.slides: # 读取每一页幻灯片 6 7 for shape in slide.shapes: #获取每一页的内容 8 9 i 阅读全文
posted @ 2020-06-09 20:24 马蹄哒哒 阅读(102) 评论(0) 推荐(0)
摘要: 1 from docx import Document 2 3 word=Document() 4 5 word.add_heading('一级标题',level=1) #增加一级标题 6 7 p1=word.add_paragraph('这是第一段') 8 9 p2=word.add_paragr 阅读全文
posted @ 2020-06-09 20:22 马蹄哒哒 阅读(179) 评论(0) 推荐(0)
摘要: 1 from docx import Document 2 3 word=Document(',,,,,,.docx') 4 5 paragraphs=word.paragraphs #返回一个列表,有多少段就有多少个值 6 7 for i in paragraphs: 8 9 print(i.te 阅读全文
posted @ 2020-06-09 20:20 马蹄哒哒 阅读(298) 评论(0) 推荐(0)
摘要: 1 from docx import Document 2 3 word =Document(r'表格名称.docx') 4 5 #读取表格 6 7 tables=word.tables 8 9 for i in tables[:]: 10 11 for j,row in enumerate(i.r 阅读全文
posted @ 2020-06-09 20:18 马蹄哒哒 阅读(208) 评论(0) 推荐(0)
摘要: 1 from turtle import * 2 bgcolor('red') 3 setup(800,500) 4 5 a={(-126,162):65,(-58,55):65,(-58,-48):65,(-126,-162):65,(-300,50):120} 6 def start(tuple 阅读全文
posted @ 2020-06-09 20:05 马蹄哒哒 阅读(85) 评论(0) 推荐(0)
摘要: 1 >>>from openpyxl.utils import get_column_letter,column_index_from string 2 3 >>>get_column_letter(2) 4 5 B 6 7 >>>column_index_from_string('B') 8 9 阅读全文
posted @ 2020-06-09 20:03 马蹄哒哒 阅读(302) 评论(0) 推荐(0)
摘要: 1 from openpyxl.styles import Font 2 3 from openpyxl import load_workbook 4 5 excel=load_workbook(r'文件名.xlsx') 6 7 sheet=excel.active 8 9 font=Font(na 阅读全文
posted @ 2020-06-09 20:02 马蹄哒哒 阅读(4469) 评论(0) 推荐(0)
摘要: -- 创建数据库 create database 数据库名 default charset =utf8; -- 创建表 create table 表名 ( id int,name char(20)); create table 表名 (id int null/not null,name char(2 阅读全文
posted @ 2020-06-09 20:00 马蹄哒哒 阅读(72) 评论(0) 推荐(0)
摘要: -- 创建用户 create user '用户名'@'ip地址' identified by 'password'; ip adress 可填%,即指可以在任何电脑上登录 -- 给用户进行授权 (一)grant 权限(select,insert,update) on 数据库名.表名 to '用户名' 阅读全文
posted @ 2020-06-09 19:59 马蹄哒哒 阅读(107) 评论(0) 推荐(0)
摘要: 1 from matplotlib import pyplot 2 import numpy 3 x=numpy.random.randn(100) #生成100个随机数,关于标准正态分布 4 y=-x+numpy.random.randn(100)*0.5 5 pyplot.scatter(x,y 阅读全文
posted @ 2020-06-09 19:57 马蹄哒哒 阅读(120) 评论(0) 推荐(0)
摘要: 1 from datetime import * 2 today=datetime.today() 3 now=datetime.now() 4 5 #判断今天是星期几 6 today.isoweekday() 7 8 #计算一周以后是星期几 9 day=timedelta(days=7) 10 t 阅读全文
posted @ 2020-06-09 19:54 马蹄哒哒 阅读(210) 评论(0) 推荐(0)
摘要: 1 import pandas 2 from matplotlib import pyplot 3 4 #设置中文字体 5 pyplot.rcParams['font.sans-serif']=['simhei'] #显示中文标签 6 pyplot.rcParams['axes.unicode_mi 阅读全文
posted @ 2020-06-09 19:50 马蹄哒哒 阅读(171) 评论(0) 推荐(0)
摘要: 1 import pandas 2 from matplotlib import pyplot 3 4 #设置中文字体 5 pyplot.rcParams['font.sans-serif']=['simhei'] #显示中文标签 6 pyplot.rcParams['axes.unicode_mi 阅读全文
posted @ 2020-06-09 19:49 马蹄哒哒 阅读(149) 评论(0) 推荐(0)
摘要: 1 import pandas 2 from matplotlib import pyplot 3 excel=pandas.read_excel('填充日期.xlsx') 4 excel.sort_values(by='score',ascending=False,inplace=True) 5 阅读全文
posted @ 2020-06-09 19:48 马蹄哒哒 阅读(142) 评论(0) 推荐(0)
摘要: 1 import pandas 2 def price_3_to_7(a): 3 return 3<=a<=7 4 def time_3_to_8(b): 5 return 3<=b<=8 6 7 excel=pandas.read_excel('填充数据.xlsx',header=3,index_ 阅读全文
posted @ 2020-06-09 19:44 马蹄哒哒 阅读(258) 评论(0) 推荐(0)