搜索到与相关的文章
Python

Python中的super用法详解

一、问题的发现与提出在Python类的方法(method)中,要调用父类的某个方法,在Python2.2以前,通常的写法如代码段1:代码段1:复制代码代码如下:classA:def__init__(self):print"enterA"print"leaveA"classB(A):def__init__(self):print"enterB"A.__init__(self)print"leaveB">>>b=B()enterBenterAleaveAlea

系统 2019-09-27 17:46:16 2130

Python

python之yield表达式学习

python中有一个略微奇怪的表达式叫yieldexpression,本文就来探究一下这是个什么东西。一步一步来。iterable复制代码代码如下:mylist=[1,2,3]foriteminmylist:printstr(item)mylist是一个列表(list),我们可以逐条取出每一个item,这个过程叫做iteration。像list这样可以用”for…in…”依次遍历的对象被称为iterable,其他的iterable还有string、tupl

系统 2019-09-27 17:45:37 2130

Python

使用Python导出Excel图表以及导出为图片的方法

本篇讲下如何使用纯python代码将excel中的图表导出为图片。这里需要使用的模块有win32com、pythoncom模块。网上经查询有人已经写好的模块pyxlchart,具体代码如下:fromwin32com.clientimportDispatchimportosimportpythoncomclassPyxlchart(object):"""ThisclassexportschartsinanExcelSpreadsheettotheFileSy

系统 2019-09-27 17:37:59 2130

编程技术

ThreadLocal-分析-总结

原文地址:http://www.iteye.com/topic/777716ThreadLocal类在Spring,Hibernate等框架中起到了很大的作用,对于其工作原理,很多网上的文章分析的不够彻底,甚至有些误解。首先,为了解释ThreadLocal类的工作原理,必须同时介绍与其工作甚密的其他几个类(内部类)1.ThreadLocalMap2.Thread可能有人会觉得Thread与ThreadLocal有什么关系,其实真正的奥秘就在Threa

系统 2019-08-29 23:50:17 2130

编程技术

简单入门正则表达式 - 第五章 多字符的匹配