摘要:
docstring: docstring表示源代码的注释,可以被help()函数识别。以''' axxxx'''的形式存在,可以为多行。可以给module,class,function增加docstring。但是docstring必须在所有的内容的最前面,例如如果给module增加docstring,该docstring必须位于文件的最前面。实例:'''#prerequisite:#basedonPython2.x#needPythonXXXmodule#makeXXXXXcommandisinPATH#usage:1)c 阅读全文
摘要:
perl中的INC变量中包含了所有的perl module的查找路径。可以使用perl -V 来查看INC的值。1)默认地INC如下:@INC: C:/Perl/site/lib C:/Perl/lib .2)设置环境变量PERL5LIB来增加到INC,例如: set perl5lib=c:\perllibs 在设置perl5lib后如下, %ENV: PERL5LIB="c:\perllibs" @INC: c:\perllibs C:/Perl/site/lib C:/Perl/lib .3)在perl程序中修改INC, 例如:#!/usr/bin/perl -w pu 阅读全文
摘要:
以下几种方法来模拟enum:(感觉方法一简单实用)#way1classDirections:up=0down=1left=2right=3printDirections.down#way2dirUp,dirDown,dirLeft,dirRight=range(4)printdirDown#way3importcollectionsdircoll=collections.namedtuple('directions',('UP','DOWN','LEFT','RIGHT'))directions=dircoll(0 阅读全文
摘要:
google C++编码规范: [英文]http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml[中文]http://yangyubo.com/google-cpp-styleguide/C++多线程编程:1)http://www.threadingbuildingblocks.org/ 2)http://www.cilk.com/ 3) http://openmp.org/wp/ 完! 阅读全文