摘要: hasattr(modulus,funcname)模块中有没有这个函数 setattr(modulus,funname,lambda )创建全局变量或者函数 delattr(modulus,funcname)删除 阅读全文
posted @ 2017-03-24 08:52 ezway 阅读(749) 评论(0) 推荐(0) 编辑
摘要: 压缩 import zipfile zip=zipfile.open('','w') zip.write('') zip.close() 解压 import zipfile zip=zipfile.open('','r') zip.extractall('') zip.extract('filena 阅读全文
posted @ 2017-03-16 19:53 ezway 阅读(235) 评论(0) 推荐(0) 编辑
摘要: 对于模块和自己写的程序不在同一个目录下,可以把模块的路径通过sys.path.append(路径)添加到程序中。 阅读全文
posted @ 2017-03-15 11:34 ezway 阅读(506) 评论(0) 推荐(0) 编辑
摘要: #! bin/usr/evn python # -*- coding:utf-8 -*- import os, sys, pyperclip import easygui as g import re file_name = 'tt3' with open(file_name, 'r', encoding='utf-8') as rf: old_text = rf.read() re... 阅读全文
posted @ 2017-03-13 17:13 ezway 阅读(146) 评论(0) 推荐(0) 编辑
摘要: #!usr/bin/evn python # -*- coding:utf-8 -*- import os,sys,pyperclip import easygui as g import re file_name='target_code' with open(file_name,'r',encoding='utf-8') as rf: old_text=rf.read() rep... 阅读全文
posted @ 2017-03-12 23:48 ezway 阅读(232) 评论(0) 推荐(0) 编辑
摘要: #include //被替换函数 void test(void) { int a=10; char s[10]={0}; printf("a=%d,s=%s\n",a,s); } int main(int argc ,char **argv) { test(); printf("hello world!\n"); return 0; } /... 阅读全文
posted @ 2017-03-11 16:35 ezway 阅读(266) 评论(0) 推荐(0) 编辑
摘要: 主要掌握tagattribfinditeritersetgetimport requests from xml.etree import ElementTree as et r=requests.get('http://www.webxml.com.cn//webservices/qqOnlineWebService.asmx/qqCheckOnline?qqCode=326533970') ... 阅读全文
posted @ 2017-03-08 16:52 ezway 阅读(104) 评论(0) 推荐(0) 编辑
摘要: __name__ 如果是主文件__name__=='__main__' 否则等于模块名 __file__ 当前文件路径 __package__ 当前文件所在包,用 . 分割 __doc__ py文件的注释 __cached__ 缓存 __loader__ __builtins__ __spec__ 给import sys,os path=os.p... 阅读全文
posted @ 2017-03-07 15:02 ezway 阅读(581) 评论(0) 推荐(0) 编辑
摘要: 编码还有很多 sha1 sha等等 阅读全文
posted @ 2017-03-06 15:38 ezway 阅读(117) 评论(0) 推荐(0) 编辑
摘要: sys.path.append() 添加import的路径;添加完后可以直接import 阅读全文
posted @ 2017-03-02 09:28 ezway 阅读(165) 评论(0) 推荐(0) 编辑