![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
shhu1993
这个作者很懒,什么都没留下…
展开
-
python的入门注意
1,python中的一切都是对象:原创 2014-11-16 19:50:36 · 365 阅读 · 0 评论 -
python的Tkinter
#-*- coding:utf-8 -*-import Tkinterfrom reportlab.pdfgen.canvas import Canvas#定义按钮class MyButton: def __init__(self , root , canvas , label , type): self.root = root self.can原创 2015-01-06 13:48:08 · 484 阅读 · 0 评论 -
Python 中的 generator ,class 的iter
参照来自:http://www.ibm.com/developerworks/cn/opensource/os-cn-python-yield/http://blog.csdn.net/myjiayan/article/details/26162911#-*- coding : utf-8 -*-class Fab(object): def __init__(sel原创 2015-01-02 16:48:46 · 880 阅读 · 0 评论 -
Python的爬虫
下载一个网页的图片:#-*- coding= utf-8 -*-import urllibimport redef getHtml(url): page = urllib.urlopen(url) html = page.read() return htmldef getImg(html): #格式的匹配 reg = r'src="(.+?\原创 2015-01-01 10:17:49 · 522 阅读 · 0 评论 -
pyhton的二叉树
# -*- coding:utf-8 -*-# file: pybtree.py#class BTree(): def __init__(self,value): self.right = None self.left = None self.value = value # def insertRight(self,va原创 2015-01-06 19:01:53 · 399 阅读 · 0 评论 -
python的执行shell命令
os.system('cat /proc/cpuinfo')返回的是执行的结果,1或者是其他output = os.popen('cat /proc/cpuinfo')print output.read()通过 os.popen() 返回的是 file read 的对象,对其进行读取 read() 的操作可以看到执行的输出。但是无法读取程序执行的返回值) import subp原创 2015-01-07 10:05:59 · 440 阅读 · 0 评论