This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
:注释区 | |
goto :code | |
依山居 1:54 2015/11/9 | |
fr修改WallpaperType.bat | |
http://www.bathome.net/thread-38056-1-1.html | |
fr是一个完整支持正则表达式查找替换的命令行工具, | |
作者网站:http://baiy.cn/utils/fr/index.htm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#python字符串切片,拼接字符串处理文本.py | |
#依山居 17:40 2015/11/10 | |
#题目来源: http://www.bathome.net/thread-38085-1-1.html | |
#相关资料:Python 序列的切片操作与技巧 | |
#http://www.cnblogs.com/ifantastic/archive/2013/04/15/3021845.html | |
out=open("out.txt","a+")#处理结果将以追加的模式输出到这个文件。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#python字符串切片,拼接字符串处理文本.py | |
#依山居 17:40 2015/11/10 | |
#题目来源: http://www.bathome.net/thread-38085-1-1.html | |
#相关资料:Python 序列的切片操作与技巧 | |
#http://www.cnblogs.com/ifantastic/archive/2013/04/15/3021845.html | |
out=open("out.txt","a+")#处理结果将以追加的模式输出到这个文件。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
C段IP筛选整理去重.PY | |
依山居 16:04 2015/11/11 | |
吐槽,这题本质是个去重处理。我写了半天没写出来。 | |
题目来源: http://www.bathome.net/thread-38037-1-2.html | |
""" | |
import time | |
start=time.time() | |
with open("a.txt","r") as f: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
goto code | |
================================================== | |
这里是注释区,随便浪吧 | |
系统日期自动从周6改为周日 http://www.bathome.net/thread-38000-1-1.html | |
依山居 8:56 2015/11/10 | |
使用datex 命令工具计算日期 http://batch-cn.qiniudn.com/tool/DateX.exe | |
HAT大神文章 Windows 2008任务计划执行bat脚本失败返回0x1 http://blog.chinaunix.net/uid-17176286-id-5156940.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
python集合解析与字典解析 C段IP筛选整理.py | |
题目来源 http://www.bathome.net/thread-38037-1-2.html | |
依山居 7:51 2015/11/20 | |
相关资料 Python 3语法小记(三) 集合set | |
http://blog.csdn.net/jcjc918/article/details/9359503 | |
集合中的值唯一,可以用来去重 | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
python字典C段IP筛选整理.py | |
题目来源 http://www.bathome.net/thread-38037-1-2.html | |
依山居 7:16 2015/11/20 | |
字典中的键唯一,所以可以用来去重 | |
""" | |
字典={} | |
with open("a.txt") as f: | |
txt=f.readlines() | |
f.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
python集合C段IP筛选整理.py | |
题目来源 http://www.bathome.net/thread-38037-1-2.html | |
依山居 7:51 2015/11/20 | |
相关资料 Python 3语法小记(三) 集合set | |
http://blog.csdn.net/jcjc918/article/details/9359503 | |
集合中的值唯一,可以用来去重 | |
""" | |
#集合的括号也是{}与字典相同,创建空集合使用set()方法 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
python正则取一列数中连续最长的奇数个数.py | |
题目来源http://www.oschina.net/code/snippet_2519674_52255 | |
大费周折地使用正则表达式来干这事~~只能处理个位数 | |
如果输入有两位数以上如47...那完蛋。不具备实用性,只能玩耍和练习 | |
依山居 8:20 2015/11/21 | |
""" | |
a=[2,3,3,0,0,2,4,7,5,7] | |
import re | |
rn=[i for i in range(0,10) if (i%2!=0)] #rn=[1, 3, 5, 7, 9] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
python算出连续是奇数最大次数.py | |
题目来源: http://www.oschina.net/code/snippet_2519674_52255 | |
依山居 8:52 2015/11/21 | |
不以结婚为目的地把程序拼成一行就是耍流氓 | |
原理是偶数返回字符串0,奇数1,以0切分成,剩下的都为1的元素,再统计连续1最长的元素 | |
""" | |
a=[2,3,3,0,0,2,4,7,5,7,324,4234,345,353,5444,55,45,9,8,69,459,469,9] | |
print(max([len(r) for r in (''.join([str(0) if (i%2 ==0) else str(1) for i in a]).split("0"))])) |