>>>print(random.random())#random()->xintheinterval[0,1)
0.9276252205739922
>>>print(random.randint(1,2))#随机取1-2之间的整数
12.随机码>>>importrandom
>>>checkcode=‘‘
>>>foriinrange(4):
...current=random.ran..
分类:
其他好文 时间:
2016-05-10 18:53:21
阅读次数:
111
from multiprocessing import Processdef f(name): print ('hello',name)if __name__ == '__main__': p=Process(target=f,args=('freeman',)) p.start() p.join( ...
分类:
编程语言 时间:
2016-05-10 16:46:59
阅读次数:
187
PIP_ADAPTER_INFO pAdapterInfo; PIP_ADAPTER_INFO pAdapter = NULL; DWORD dwRetVal = 0; UINT i; /* variables used to print DHCP time info */ struct tm ne ...
分类:
系统相关 时间:
2016-05-10 14:09:14
阅读次数:
177
使用urllib2访问页面:
import urllib2
import cookielib
url = "http://www.baidu.com"
print 'The first method : '
response1 = urllib2.urlopen(url)
print response1.getcode()
print len(response1.read())
print...
分类:
编程语言 时间:
2016-05-10 12:59:19
阅读次数:
336
基本格式:find【路径】【-选项】【-操作】一、路径1../当前目录2.~用户家目录3./home当前目录下的家目录4./home/home目录5./home/wang//home目录下的wang目录二、选项1.name选项:使用文件名(‘filename‘)来匹配:可以和其他选项一起使用#find./-name"[A-Z]*"-print查找当前目..
分类:
其他好文 时间:
2016-05-10 11:12:57
阅读次数:
218
awk是按照流来处理的,所以处理1-5G的文本数据相对还是可以的!规定日志格式$17为domainname$19为request$21为响应状态码应用1:匹配统计F5日志中,含有某个域名的数量可以按照以下方法来套[root@CentOS-6-121scripts]#awk-F:‘$1=="root"{print$0}‘/etc/passwd|wc-l
1对以上进行..
分类:
其他好文 时间:
2016-05-09 22:14:45
阅读次数:
265
1、cd命令 这是一个非常基本,也是大家经常需要使用的命令,它用于切换当前目录,它的参数是要切换到的目录的路径,可以是绝对路径,也可以是相对路径。如: [plain] view plain copy print? 2、ls命令 这是一个非常有用的查看文件与目录的命令,list之意,它的参数非常多,下 ...
分类:
系统相关 时间:
2016-05-09 20:32:13
阅读次数:
273
问题:按照第二列范围压缩显示catfile:111111123337222622291113222103333333433353336result:1111-32226-62229-103333-7解答:sort-n-k2,2file|awk‘{a[$1]=a[$1]""$2}END{for(iina)printi,a[i]}‘|awk‘{print$1,$2"-"$NF}‘1111-32226-103333-7
分类:
其他好文 时间:
2016-05-09 19:04:14
阅读次数:
123
Array = [[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]]print (Array)for i in range(len(Array)): for j in range(i,len(Array[i])): tmp = Array[i][j] Ar ...
分类:
编程语言 时间:
2016-05-09 18:49:05
阅读次数:
222
版权声明:本文为博主原创文章,未经博主允许不得转载。 版权声明:本文为博主原创文章,未经博主允许不得转载。 此处使用log4j,加入jar包,然后在src路径下加入:log4j.properties文件 填入以下配置就可以打印了 [plain]view plain copy print? log4j ...
分类:
数据库 时间:
2016-05-09 18:43:41
阅读次数:
204