To be a better coder
发布时间:2019-01-24 13:35:46
[root@localhost /]# [root@localhost /]# cat cla.py#!/bin/pythonclass zhu(): def __init__(self,chang,kuan,gao): self.chang=chang self.kuan=kuan self.gao=gao &n.........【阅读全文】
发布时间:2019-01-24 13:09:48
[root@localhost /]# [root@localhost /]# cat zlg.py #!/bin/pythonfrom functools import reducea=[1,2,3,4,5,6,7,8,9]b=[2,3,4,5,6,7,8,9,1]r=map(lambda x,y:x+y,a,b)print list(r)x=3y=4print x if x>y else yp=reduce(lambda x,y:x+y,a)print p[root@localhost /]# [root@localhost /]# .........【阅读全文】
发布时间:2019-01-23 17:20:57
帮助函数:>>> help(str.join)>>> help(str)>>> [root@localhost /]# cat zifuchuan.py #!/bin/pythona='aaaaaaaaaaaaa'b='bbbbbbbbbbbb'c=a+bprint cd=['ddddddd','eeeeeeee','fffffffff']g=':'.join(d)h=''.join(d)print g,ho=['aaaaa',12,'23']print ''.join(str(x) for x in o)[root@localhost /]# .........【阅读全文】
发布时间:2019-01-22 12:55:46
netstat -r| sed '1,3d' | awk '{print $8}' | sort -k2n | awk '!i[$1]++'......【阅读全文】
发布时间:2019-01-22 10:43:36
[root@localhost /]# cat zifuchuan.py #!/bin/pythonimport res=' ---asdegsd:34fr++++ 'print(s.strip())print(s.lstrip())print(s.rstrip())print(s[:11]+s[12:])print(s.replace('-','h'))print(s.translate(None,'a'))print(re.sub('a','',s))[root@localhost /]# ......【阅读全文】