06 2011 档案
*py_learn
摘要:#enconding = utf-8a = [1,2,3]b = ['a','b','c']## 并行遍历zip(a,b)for (x,y) in zip(a,b): z[x] = ydict(zip(a,b)) ## zip 构造字典map(None,a,b)## 重新运算出参数的内容,把字符串转化成对象 [pickle module]eval('a') # [1, 2, 3]## append 在原处修改 , 返回 None ---> sort()a.append('a')a # [1, 2, 3, &# 阅读全文
posted @ 2011-06-29 17:14 eth0 阅读(167) 评论(0) 推荐(0)
*py_sinatpy
摘要:# http://open.weibo.com/wiki/index.php/SDK# 下载sinatpy解压放到py安装目录下的Libs就好用了# -*- coding:utf-8 -*-import unittestfrom weibopy.auth import OAuthHandlerfrom weibopy.api import API## 你注册应用获取的key and secretconsumer_key = 'xxx' consumer_secret = 'xxx'## url = auth.get_authorization_url() ## 阅读全文
posted @ 2011-06-28 18:08 eth0 阅读(171) 评论(0) 推荐(0)
*qt_one_two<QSpinBox,QSlider,QWidget,QHBoxLayout>
摘要:#include <QApplication>#include <QLabel>#include <QPushButton>#include <QSpinBox>#include <QSlider>#include <QHBoxLayout>int main(int argc,char* argv[]){ QApplication app(argc,argv); //QLabel* label = new QLabel("<h2><i>xxx</i>""&l 阅读全文
posted @ 2011-06-25 20:54 eth0 阅读(384) 评论(0) 推荐(0)
*qt_one_one
摘要:#include <QApplication>#include <QLabel>int main(int argc,char* argv[]){ QApplication app(argc,argv); QLabel* label = new QLabel("<h2><i>xxx</i>""<font color=red>xxx</font></h2>"); label->show(); return app.exec();}#include <Q 阅读全文
posted @ 2011-06-25 19:51 eth0 阅读(185) 评论(0) 推荐(0)
*py_moudle<Tkinter,urllib>
摘要:#-*- coding:utf-8 -*-from Tkinter import *import urllibclass window(object): def __init__(self,root): self.rr = root self.entry = Entry(self.rr) self.entry.place(x=5,y=15) self.button = Button(self.rr,text='website',command=self.solve) self.button.place(x=100,y=15) self.edit = Text(self.rr,h 阅读全文
posted @ 2011-06-24 10:48 eth0 阅读(165) 评论(0) 推荐(0)
*py_moudle<urllib>
摘要:import urllibdef hook(a,b,c): #回调函数 tem = 100.0 * a * b / c if tem>100: tem=100 print '%.2f%%' % temurl = "http://192.168.102.42/www/"path = "d:\\1.txt"urllib.urlretrieve(url, path, hook) # 下载htmlf = urllib.urlopen("xxx") print f.read() # 类似于文件操作 readlines, r 阅读全文
posted @ 2011-06-21 20:05 eth0 阅读(155) 评论(0) 推荐(0)
python gui tkinter
摘要:import Tkinterroot = Tkinter.Tk()root.mainloop()显示一个tk窗口 阅读全文
posted @ 2011-06-14 20:20 eth0 阅读(211) 评论(0) 推荐(0)