码迷,mamicode.com
首页 >  
搜索关键字:print    ( 43532个结果
装饰器(3)
def?log(text): if?not?callable(text): def?decorator(func): @functools.wraps(func) def?wrapper(*args,**kw): print(‘%s?%s:()‘?%?(text,func.__name__)) return?func(*args,**kw...
分类:其他好文   时间:2015-08-21 15:54:11    阅读次数:148
php进行多个数组合并zip
$a = array_zip(array("Dog","Cat","Horse"), array(1,2,3), array("lihd", "xp", "win8.1")); print_r($a); function array_zip(){ $c = ...
分类:编程语言   时间:2015-08-21 14:59:15    阅读次数:155
装饰器-decorator
>>>def?now(): ????print(‘2015-8-21‘) ???? >>>f?=?now >>>f() 2015-8-21 此时当我们想要在实现 now( ) 函数调用的前后自动打印日志,但是不更改 now( ) 函数的定义,我们可以使用装饰器的方式: >>...
分类:其他好文   时间:2015-08-21 13:53:41    阅读次数:199
linux查找关键字在php出现的次数
查找CleverCode在当前目录以及子目录,所有的php出现大于0的次数。 # find -type f -name '*.php' | xargs grep CleverCode ./*.php -rc | awk  -F ':'  '$2 > 0 {print $1,$2}' | grep -v '/.svn/' | sort -n -k 2 -r 1)find -typ...
分类:Web程序   时间:2015-08-21 13:40:36    阅读次数:166
python 函数的默认参数
直接上代码: first?=?1 second?=?2 def?haha(first=first,second=second):#默认值是上面定义的两个变量 ????print?"first:?%d"%first ????print?"second:?%d"%second haha() first?+=?5 secon...
分类:编程语言   时间:2015-08-21 11:35:25    阅读次数:164
理解 *args **kw
*args是非关键字参数,用于元组,**kw是关键字参数,用于字典 举例: 1.*args ? def?tupleArgs(arg1,?arg2=?‘B‘,?*arg3): ????print(‘arg?1:%s?‘?%?arg1) ????print(‘arg?2:%s?‘?%?arg2) ?...
分类:其他好文   时间:2015-08-21 11:32:34    阅读次数:95
大整数阶乘的计算
1 #include 2 3 #define mo 10000 4 int ans[1000001]; 5 //这里高精度整数存储格式是:ans[0]存储位数,低位在前,高位在后,每一个ans[i]存储四位整数 6 7 void mul(int *,int); 8 void print_ar...
分类:其他好文   时间:2015-08-21 09:20:51    阅读次数:169
addslashes的一些问题
至于宽字节注入,有人写过,我就不多写了:https://www.91ri.org/8611.htmlhttp://netsecurity.51cto.com/art/201404/435379_4.htm针对iconv()函数,我就试着写了个utf-8和gbk的url编码转换importos,urllib print"""ifuwantchangegbktoutf-8,pleaseinputgbk,soasinpututf-8. in..
分类:其他好文   时间:2015-08-21 00:27:39    阅读次数:261
File:方法(详细)
File方法:Name()方法:获取File的名称。 getPath()方法:获取File的路径。 getAbsolutePath()方法:获取文件或目录的绝对路径名称。 getParent()方法:获取文件或目录的父路径名称。 isAbsolute ()方法:判断文件或目录的父路径是否绝对路径。 File file=new File("e:/111"); System.out.print...
分类:其他好文   时间:2015-08-20 22:34:42    阅读次数:221
linux shell自动输入实现
1 #!/bin/sh2 3 while read line4 do5 str=$line6 var1=`echo $str|awk -F ' ' '{print $1}'`7 var2=`echo $str|awk -F ' ' '{print $2}'`8 var3=`echo $str|awk...
分类:系统相关   时间:2015-08-20 22:15:04    阅读次数:304
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!