Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3646856
  • 博文数量: 880
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 6155
  • 用 户 组: 普通用户
  • 注册时间: 2016-11-11 09:12
个人简介

To be a better coder

文章分类

全部博文(880)

文章存档

2022年(5)

2021年(60)

2020年(175)

2019年(207)

2018年(210)

2017年(142)

2016年(81)

发布时间:2019-02-26 10:53:31

[root@localhost /]# [root@localhost /]# cat split.py #!/bin/pythonimport res='aa,bb:cc;dd/tee<ff>gg'def mysplit(s,symbol):    t=[s]    for num in symbol:        res=[]        map(lambda x:res.extend(x..........【阅读全文】

阅读(4527) | 评论(0) | 转发(0)

发布时间:2019-02-25 17:18:32

[root@localhost /]# [root@localhost /]# cat strduiqi.py #!/bin/pythonimport os, statli=os.listdir('/software/script/shell')st=[n for n in li if n.endswith(('.sh','.py'))]for nm in st:    os.chmod(nm,os.stat(nm).st_mode | stat.S_IXGRP)[root@localhost /]# [root@localhost /]# .........【阅读全文】

阅读(1890) | 评论(0) | 转发(0)

发布时间:2019-02-25 16:57:05

[root@localhost /]# cat strduiqi.py #!/bin/pythonimport relog=open('/var/log/pacman.log').read()print re.sub('(\d{4})-(\d{2})-(\d{2})',r'\2/\3/\1',log)[root@localhost /]# 捕获组命名[root@localhost /]# cat strduiqi.py #!/bin/pythonimport relog=open('/var/log/pacman.log').read()print re.sub.........【阅读全文】

阅读(2517) | 评论(0) | 转发(0)

发布时间:2019-02-25 16:39:44

[root@localhost /]# cat strduiqi.py #!/bin/pythonmydict={'name':'zhuliguo','age':29,'student':'student'}length=max(map(len,mydict.keys()))for n in mydict:    print(n.ljust(length),':',mydict[n])[root@localhost /]# ......【阅读全文】

阅读(8523) | 评论(0) | 转发(0)

发布时间:2019-02-25 11:01:54

访问熊猫TV查看LOL主播及关注人数并按顺序打印:[root@localhost /]# cat pachong.py #!/bin/pythonfrom urllib import requestimport reclass Spider():    url='https://www.panda.tv/cate/lol'    root_pattern = '<div class="video-info">([\s\S]*?)</div>'    .........【阅读全文】

阅读(4179) | 评论(0) | 转发(0)
给主人留下些什么吧!~~
留言热议
请登录后留言。

登录 注册