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 socket发送魔法包网络唤醒开机.py | |
2016年3月20日 20:40:42 codegay | |
_(:3」∠)_愿佛祖保佑我主永无BUG→_→ | |
参考不止以下文章,不能一一列出,均在此表示感谢: | |
一个简单的python socket编程: | |
http://openexperience.iteye.com/blog/145701 |
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
#=julia与python中的列表解析.jl | |
2016年3月16日 07:30:47 codegay | |
julia是一门很年轻的科学计算语言 | |
julia文档 https://julia-zh-cn.readthedocs.org/zh_CN/latest/ | |
初学python几个月,初学julia才几天,理解与认识不到位, | |
如发现有误的地方,请指出,谢谢。 | |
=# | |
#= |
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
#=julia排除目录调用命令备份文件.jl | |
2016年3月15日 16:54:34 codegay | |
julia是一门很年轻的科学计算语言, | |
综合很了很多语言的特性,号称有很好的性能。 | |
灵活,上手快,这门语言将来应用范围可能比较广。 | |
=# | |
d=readdir("d:/") | |
f=["快盘","AV","\$RECYCLE.BIN","temp","System Volume Information"] |
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利用or在列表解析中调用多个函数.py | |
2016年3月15日 05:08:42 codegay | |
""" | |
'''有时候我会在列表解析中write文件, | |
或者调用print显示输出,不是为了收集结果, | |
而是因为能省代码行数''' |
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
#Julia列出文件名-文件大小.jl | |
#http://bbs.bathome.net/thread-39660-2-1.html | |
#julia 版 codegay 2016年3月13日 13:35:54 | |
for r=readdir() | |
f=stat(r).size | |
println("文件名:$r $f 字节"); | |
end |
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://bbs.bathome.net/thread-39660-1-1.html | |
2016年3月12日 23:52:29 codegay | |
""" | |
import os | |
[print(os.path.basename(r),str(os.path.getsize(r))+"我知道你很不爽,你咬我啊") for r in os.listdir(".") if os.path.isfile(r)] | |
input() |
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解无忧公主数学题107.py | |
http://mp.weixin.qq.com/s?__biz=MzI5ODEwMDQyNw==&mid=402343371&idx=1&sn=0de458a3653a0070ba3912bda7d01db9&scene=25#wechat_redirect | |
2016年3月9日 12:49:55 codegay | |
""" | |
def ff1(): | |
#用程序自动把index对应位置的数字切出来。 | |
exp=990*991*992*993 | |
s="966428A91B40" | |
#问AB=多少 |
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-IIS7.5-web.config-rewrite规则转.htaccess.py | |
2016年3月8日 12:02:31 codegay | |
""" | |
import re | |
with open("Web.config",encoding="utf-8") as f: | |
txt=f.read() | |
with open(".htaccess","w+") 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
""" | |
python解无忧公主数学题108回文.py | |
题目来源: http://mp.weixin.qq.com/s?__biz=MzI5ODEwMDQyNw==&mid=402360973&idx=1&sn=31014f87b8e65c9cd1d40c625c9c3d90&3rd=MzA3MDU4NTYzMw==&scene=6#rd | |
2016年3月7日 14:59:17 codegay | |
""" | |
#利用到了集合的特性,进行集合交集运算 | |
#2016年3月8日 05:59:41 | |
def 方法1(): | |
f=lambda x,y: True if str(x*y)==str(x*y)[::-1] else None |
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
""" | |
python3取出重复3次的字符串保存为3列.py | |
http://bbs.bathome.net/thread-39592-1-1.html | |
codegay 2016年3月8日 00:56:57 | |
""" | |
#测试数据 | |
a=""" | |
01 01 01 02 02 02 03 03 03 04 05 05 |