摘要:
浅拷贝的方式有: lst=[1,2,3] (1)直接赋值: lst_cp = lst (2)for循环遍历生成:lst_cp= [i for i in lst] (3)copy模块下,copy.copy仍为浅拷贝 深拷贝的方式 (1)借助copy模块 >>> import copy >>> lst_ 阅读全文
2016年4月6日
2016年4月5日
摘要:
执行错误: root@zte-desktop:/home/ubuntu/python-threads# python eventlet.pyTraceback (most recent call last): File "eventlet.py", line 3, in <module> impor 阅读全文
2016年3月23日
摘要:
注意,语句(a)(b)处不能用以下语句代替: queueA.size是unsigned类型(size_type), 直接进行运算会出问题, 上述语句执行结果,比正确结果少一次queueA.pop。 阅读全文
摘要:
#include #include using namespace std; class doubleStackToQueue { private: stack stk_in; stack stk_out; public: void push(int element); void pop(); }; void doubleStackToQueue::... 阅读全文
2016年3月20日
摘要:
要求:存在很多元素,如<A,B>,<a,b>,<b,d>,<B, E>, <#,1>, <1, 8>,将这些元素进行分类并排序, 使之输出结果为: <A,B> -- <B,E>; <a,b> -- <b,d> ; <#,1> -- <1,8>; 函数原型:list<listNode> listEle 阅读全文
2016年3月19日
摘要:
from _ctypes_test import func def deco1(arg): def mid_deco1(function): def new_func(): print ("deco1 > new_function : arg=%s" %(arg)) return function() ... 阅读全文
2016年3月16日
摘要:
使用与来源: makefile文件(可由./configure创建)被make命令读取,make 命令执行时,需要一个 Makefile 文件,以告诉 make 命令需要怎么样的去编译和链接程序。 功能: 定义了一系列的规则来指定,哪些文件需要先编译, 哪些文件需要后编译,哪些文件需要重新编译,甚至 阅读全文
摘要:
其他操作可参考:http://www.cnblogs.com/flatfoosie/archive/2010/12/22/1914055.html 阅读全文
摘要:
1, string转const char* 类型 string str = "abcdef"; const char* con_str = string.c_str() 2, const char*转string 类型 直接赋值 const char* con_str = "abc"; string 阅读全文
摘要:
1 使用profile分析函数性能示例1, 以profile为例: import profile def profileTest(): Total =1; for i in range(10): Total=Total*(i+1) print Total return Total if __name 阅读全文