![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
文章平均质量分 81
Smile_Benson
这个作者很懒,什么都没留下…
展开
-
Python - 基础知识1
1. python一些基础知识记录下: 继承和多态: __metaclass__ = type #python新类语法 class Calculator: def calculate(self, expression): self.value = eval_r(expression) def mShow(self): print "Calcula原创 2016-05-19 23:28:00 · 356 阅读 · 0 评论 -
Python - 基础知识2
1. 类添加新属性和新属性赋值: __metaclass__ = type class Rectangle: def __init__(self): self.width = 0 self.height = 0 def __setattr__(self, name, value): if name == 'size': # size原创 2016-05-19 23:28:03 · 298 阅读 · 0 评论 -
Python - 基础知识3
1. 迭代器: __metaclass__ = type class Fibs(list): #斐波那契序列 def __init__(self): self.a = 0 self.b = 1 def next(self): self.a, self.b = self.b, self.a+self.b return s原创 2016-05-19 23:28:05 · 398 阅读 · 0 评论 -
Python - 正则表达式指南
从这里学习而得:http://www.cnblogs.com/huxi/archive/2010/07/04/1771073.html 1. 正则表达式基础 1.1. 简单介绍 正则表达式并不是Python的一部分。正则表达式是用于处理字符串的强大工具,拥有自己独特的语法以及一个独立的处理引擎,效率上可能不如str自带的方法,但功能十分强大。得益于这一点,在提供了正则表达式的语言里,正则表达式的原创 2016-05-19 23:28:08 · 1425 阅读 · 0 评论 -
Python - 基础模版学习
1. 正则表达式替换: # templates.py import fileinput, re field_pat = re.compile(r'\[(.+?)\]') scope = {} def replacement(match): code = match.group(1) try:#scope提供名称空间 code = 'a=1', eval_r(code,scope);原创 2016-05-19 23:28:11 · 363 阅读 · 0 评论 -
Python - 网络基础
1. 服务器端 和 客户机端: socket server: import socket so = socket.socket() host = socket.gethostname() #获取本地服务器的名称 port = 8000#设置服务器端口 so.bind( (host, port) ) #绑定主机名和端口号, 类型是元组 so.listen(5) #设置最大的连接请求. 进入监听状原创 2016-05-19 23:28:13 · 340 阅读 · 0 评论 -
Python - pyqt 和 opencv
pyqt 和 opencv学习 在网上找资料, 好多pyqt和opencv的东东, 学了一个星期的python, 找些好玩的, 才qt原来还支持python 才知道qt工具里面有python一部分. 至于opencv, 在官网上看见了python版本的应用, 之前做人脸识别的时候了解过. 最近发现一个前辈的博客写了一份pyqt+opencv的视频播放和录制的代码.(http://my原创 2016-05-19 23:28:16 · 732 阅读 · 0 评论