码迷,mamicode.com
首页 >  
搜索关键字:def    ( 28626个结果
python 类的基础知识
1、创建类 1 class Book(object):2 def __init__(self,b): #定义构造器3 self.name=b4 print self.name5 def updatename(self,a):6 s...
分类:编程语言   时间:2014-09-19 20:59:15    阅读次数:255
python build-in function __cmp__
读王纯业前辈的笔记遇到个很坑的例子A namespace is a mapping from names to objects>>> class a: def __cmp__(self,other): if other > 0 : print 'other > 0' ;return -1 eli.....
分类:编程语言   时间:2014-09-19 18:59:45    阅读次数:188
Codeforces Round #267 (Div. 2)
A 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include10 using namespace std;11 #define N 10000012 #def....
分类:其他好文   时间:2014-09-19 15:31:45    阅读次数:214
创建一个简单的web.py项目
这个例子你可以看到可以再模板中编写python代码,也会粗略的编写第一个web.py程序了。步骤如下。1、首先看结构2.在testquery2.py中输入:import webimport osclass index: def GET(self): print "进入index"...
分类:Web程序   时间:2014-09-19 13:37:55    阅读次数:138
HDU 2255 - 奔小康赚大钱
Kuhn - Munkres 算法,第一次拍各种问题,不过还是A掉了。。/*ID:esxgx1LANG:C++PROG:hdu2255*/#include #include #include #include using namespace std;typedef long long LL;#def...
分类:其他好文   时间:2014-09-18 23:40:04    阅读次数:230
Python类
Python使用中面向对象的语言,支持继承、多态;    定义一个Person类: >>> class Person: ... def sayHello(self): ... print('hello') ... >>> Person.sayHello(None) hello >>> Person().sayHello() hello    可以修...
分类:编程语言   时间:2014-09-18 22:22:34    阅读次数:255
关于DLL模块导出函数
当然以前我知道有一个.def文件的,里面写的都是需要导出的函数,以为与__declspec(dllexport)作用是一样的。但是今天看公司项目源码的时候才知道,它们两个导出方法是有一定的区别的,编译导出来的符号名称是略有不同的,如果供其他语言调用dephin,等,就麻烦些。references:h...
分类:其他好文   时间:2014-09-18 18:14:04    阅读次数:159
[building block] merge sort @ Python
Here is the basic algorithm about merge sort:def merge(s1,s2,s): i=j=0 while i + j < len(s): if j == len(s2) or (i < len(s1) and s1[i] < ...
分类:编程语言   时间:2014-09-18 11:17:13    阅读次数:165
Bottle python
1. hello worldimport bottle@bottle.route('/')def home_page(): return "hello world\n"@bottle.route('/testpage')def test_page(): return "this is a...
分类:编程语言   时间:2014-09-18 09:43:33    阅读次数:214
web.py简易示例
code.pyimport weburls = ( '/', 'index')class index: def GET(self): return "Hello, world,caixianfeng write for the first web.py!"if __name...
分类:Web程序   时间:2014-09-18 00:35:33    阅读次数:355
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!