随笔分类 - Python 学习
摘要:@property 把对象封装为属性,@classmethod 类对象
阅读全文
摘要:认证文件 {"username":"user1","pwd":123}{"username":"user2","pwd":123}{"username":"user3","pwd":123}{"username":"user4","pwd":123}
阅读全文
摘要:1 def read_data(): 2 with open("test","r",encoding="utf-8") as f : 3 for data in f: 4 yield data 5 6 g = read_data() 7 8 all_population = sum(eval(dt)
阅读全文
摘要:1 f = open("text_file.txt","rb" ) 2 3 for ln in f: 4 offs = -10 5 while True: 6 print(offs) 7 f.seek(offs,2) 8 data = f.readlines() 9 if len(data) > 1
阅读全文
摘要:1 def count_and_sum(start,end,a=0,b=0): 2 if start == end: 3 return a,b 4 5 if start%3 == 0 and start%7 == 0: 6 a += 1 7 b += start 8 9 return count_a
阅读全文
摘要:#Author:xiesongyouChina= { '山东' : { '青岛' : ['四方','黄岛','崂山','李沧','城阳'], '济南' : ['历城','槐荫','高新','长青','章丘'], '烟台' : ['龙口','莱山','牟平','蓬莱','招远'] }, '
阅读全文
摘要:#Atuhor:xiesongyoufor i in range(1,10): for j in range(1,i+1): print("%d * %d = %-8d"%(j,i,i*j),end="") print()print("- - " * 35)for i in range(9,0,-1
阅读全文
摘要:import sysfrom PyQt5.QtWidgets import (QWidget, QToolTip,QMessageBox, QPushButton, QApplication,QDesktopWidget)from PyQt5.QtGui import QFont,QIconfrom
阅读全文
摘要:from PyQt5.QtCore import QDate, QTime, QDateTime, Qtnow = QDate.currentDate()print(now.toString(Qt.ISODate))print(now.toString(Qt.DefaultLocaleLongDat
阅读全文
摘要:from pptx import *from pptx.util import Pt,Inchesfrom pptx.dml.color import RGBColorfrom pptx.chart.data import ChartDatafrom pptx.enum.shapes import
阅读全文
摘要:import xlrdfrom pptx import *from pptx.util import Ptfrom pptx.dml.color import RGBColorfrom pptx.chart.data import ChartDatacontr_col = 0contr_row =
阅读全文
摘要:prs = Presentation('temp.pptx')xl=xlrd.open_workbook('11月分报告数据.xlsx')#幻灯片3slide=prs.slides[2]j=0for shape in slide.shapes: if not shape.has_chart: con
阅读全文
摘要:prs = Presentation('2017年北科建第一阶段满意度调研报告V.7.0汇报.pptx')slide=prs.slides[2]j=1for shape in slide.shapes: if not shape.has_text_frame: continue text_frame
阅读全文
摘要:prs = Presentation('2017年北科建第一阶段满意度调研报告V.7.0汇报.pptx')slide=prs.slides[4]for shape in slide.shapes: if not shape.has_table: continue else: t = shape.ta
阅读全文
摘要:from pptx import Presentationfrom pptx.util import Inchesfrom pptx.chart.data import ChartDatafrom pptx.enum.chart import XL_TICK_MARKfrom pptx.util i
阅读全文
摘要:from pptx import Presentationfrom pptx.util import Inchesfrom pptx.chart.data import ChartDatafrom pptx.enum.chart import XL_TICK_MARKfrom pptx.util i
阅读全文
摘要:from pptx import Presentationfrom pptx.util import Inchesfrom pptx.chart.data import ChartDatafrom pptx.enum.chart import XL_TICK_MARKfrom pptx.util i
阅读全文
摘要:import numpy as npimport matplotlib.pyplot as pltfrom pylab import mplfrom matplotlib.font_manager import FontPropertiesfont = FontProperties(fname=r"
阅读全文
浙公网安备 33010602011771号