#!/usr/bin/envpython#-*-coding:utf-8-*-fromPyQt4importQtCore,QtGuiclassmyWindow(QtGui.QMainWindow):def__init__(self,parent=None):super(myWindow,self)....
分类:
其他好文 时间:
2014-11-04 17:19:36
阅读次数:
377
importsys,osfromPyQt4importQtCore,QtGuiclassThumbListWidget(QtGui.QListWidget):def__init__(self,type,parent=None):super(ThumbListWidget,self).__init__...
分类:
其他好文 时间:
2014-11-04 17:19:01
阅读次数:
230
importsysfromPyQt4.QtGuiimportQApplication,QWidget,\QVBoxLayout,QListWidget,QAbstractItemViewclassWidget(QWidget):def__init__(self,parent=None):QWidge...
分类:
其他好文 时间:
2014-11-04 17:08:35
阅读次数:
401
importthreadingimportsys,timefromPyQt4importQtCore,QtGuiimportpsutilimportosclassMainWindow(QtGui.QMainWindow):def__init__(self):super(MainWindow,self...
分类:
其他好文 时间:
2014-11-04 17:01:15
阅读次数:
114
比较简单,就直接上代码了:import weburls = ( '/', 'hello')app = web.application(urls, globals())class hello: def GET(self): print web.input() ...
分类:
Web程序 时间:
2014-11-04 16:37:04
阅读次数:
206
bfs
搞清楚是转弯而不是步数。所以需要一个方向一直走下去直到边界或者墙。
还有就是注意题意。给出起点终点的 x,y 位置是交换的。 题目是下标1开始。注意。
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#def...
分类:
其他好文 时间:
2014-11-04 11:08:27
阅读次数:
192
#线程1->队列->线程2->url_web####!/usr/bin/envpython
#!coding=utf-8
#!by=xiaohe
importQueue,threading,time,random
frommoniItemsimportmon
importurllib2
fromflaskimportFlask,request,json
queueLock=threading.Lock()
classt1(threading.Thread):
def__in..
分类:
编程语言 时间:
2014-11-04 07:01:20
阅读次数:
202
主要内容:字符串内存分配、合并两个字符串
#include
#include
int main(int argc, char *argv[])
{
/*
* 字符串操作:内存分配
* 字符串s和t,希望将这两个字符串连接成单个字符串r
*/
char* s = "abc";
char* t = "def";
// 方法一: 缺点:1、不能确定r指向何处;2、同...
分类:
编程语言 时间:
2014-11-03 22:33:51
阅读次数:
260
【继承示意图】
类是实例的工厂, OOP就是在树中搜索属性,类其实就是变量名与函数打成的包
. 每个class语句会生成一个新的类对象
. 每次类调用时,就会生成一个新的实例对象
. 实例自动连接到创建这些实例的类
. 类连接到超类的方式是,将超类列在类头部(),其从左到右的顺序会决定树中的次序
有几点需要注意:
. 属性通常是在class语句中通过赋值语句添加在类中,而不是嵌入函数的def语句中
. 属性通常是在类中,对传给函数的特殊参数self,做赋值运算而添加在实例中的
【方法调用的两种方式】...
分类:
编程语言 时间:
2014-11-03 16:25:52
阅读次数:
350
根据题意,我们不能用到if/else/for/while等关键字.
--------------思考中------------
思路:
1.用递归实现循环
2.递归的终止条件不用if怎么判断呢? 答案是字典,其中用not not n来把数字n转成bool.
上代码:
def sum_(n):
return n + {
True:...
分类:
编程语言 时间:
2014-11-03 16:24:45
阅读次数:
189