随笔分类 -  Python 学习

摘要:@property 把对象封装为属性,@classmethod 类对象 阅读全文
posted @ 2018-08-04 08:40 沧海一粒水 阅读(171) 评论(0) 推荐(0)
摘要:认证文件 {"username":"user1","pwd":123}{"username":"user2","pwd":123}{"username":"user3","pwd":123}{"username":"user4","pwd":123} 阅读全文
posted @ 2018-07-29 15:15 沧海一粒水 阅读(107) 评论(0) 推荐(0)
摘要:方法1 2 3 阅读全文
posted @ 2018-07-28 13:44 沧海一粒水 阅读(145) 评论(0) 推荐(0)
摘要: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) 阅读全文
posted @ 2018-07-28 08:56 沧海一粒水 阅读(225) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2018-07-28 08:53 沧海一粒水 阅读(92) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2018-07-28 08:25 沧海一粒水 阅读(358) 评论(0) 推荐(0)
摘要:#Author:xiesongyouChina= { '山东' : { '青岛' : ['四方','黄岛','崂山','李沧','城阳'], '济南' : ['历城','槐荫','高新','长青','章丘'], '烟台' : ['龙口','莱山','牟平','蓬莱','招远'] }, ' 阅读全文
posted @ 2018-01-21 17:31 沧海一粒水 阅读(133) 评论(0) 推荐(0)
摘要:读取文件: 阅读全文
posted @ 2018-01-21 10:11 沧海一粒水 阅读(182) 评论(0) 推荐(0)
摘要:#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 阅读全文
posted @ 2018-01-20 11:55 沧海一粒水 阅读(172) 评论(0) 推荐(0)
摘要:import sysfrom PyQt5.QtWidgets import (QWidget, QToolTip,QMessageBox, QPushButton, QApplication,QDesktopWidget)from PyQt5.QtGui import QFont,QIconfrom 阅读全文
posted @ 2018-01-05 19:00 沧海一粒水 阅读(180) 评论(0) 推荐(0)
摘要:from PyQt5.QtCore import QDate, QTime, QDateTime, Qtnow = QDate.currentDate()print(now.toString(Qt.ISODate))print(now.toString(Qt.DefaultLocaleLongDat 阅读全文
posted @ 2018-01-04 23:20 沧海一粒水 阅读(5370) 评论(0) 推荐(0)
摘要:from pptx import *from pptx.util import Pt,Inchesfrom pptx.dml.color import RGBColorfrom pptx.chart.data import ChartDatafrom pptx.enum.shapes import 阅读全文
posted @ 2017-12-29 08:11 沧海一粒水 阅读(756) 评论(0) 推荐(0)
摘要:import xlrdfrom pptx import *from pptx.util import Ptfrom pptx.dml.color import RGBColorfrom pptx.chart.data import ChartDatacontr_col = 0contr_row = 阅读全文
posted @ 2017-12-27 16:31 沧海一粒水 阅读(248) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2017-12-27 13:11 沧海一粒水 阅读(2399) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2017-12-25 11:30 沧海一粒水 阅读(272) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2017-12-25 09:26 沧海一粒水 阅读(269) 评论(0) 推荐(0)
摘要:from pptx import Presentationfrom pptx.util import Inchesfrom pptx.chart.data import ChartDatafrom pptx.enum.chart import XL_TICK_MARKfrom pptx.util i 阅读全文
posted @ 2017-12-20 08:26 沧海一粒水 阅读(321) 评论(0) 推荐(0)
摘要:from pptx import Presentationfrom pptx.util import Inchesfrom pptx.chart.data import ChartDatafrom pptx.enum.chart import XL_TICK_MARKfrom pptx.util i 阅读全文
posted @ 2017-12-20 08:25 沧海一粒水 阅读(1278) 评论(0) 推荐(0)
摘要:from pptx import Presentationfrom pptx.util import Inchesfrom pptx.chart.data import ChartDatafrom pptx.enum.chart import XL_TICK_MARKfrom pptx.util i 阅读全文
posted @ 2017-12-17 19:22 沧海一粒水 阅读(2848) 评论(0) 推荐(0)
摘要:import numpy as npimport matplotlib.pyplot as pltfrom pylab import mplfrom matplotlib.font_manager import FontPropertiesfont = FontProperties(fname=r" 阅读全文
posted @ 2017-12-16 16:19 沧海一粒水 阅读(1308) 评论(0) 推荐(0)