python
始终不过是__伪物
这个作者很懒,什么都没留下…
展开
-
根据关键字查找文件
根据关键字查找文件def getfile(path,word): for filename in os.listdir(path): file = os.path.join(path,filename) if os.path.isfile(file) and word in filename: print file ...原创 2018-08-10 16:11:23 · 871 阅读 · 0 评论 -
flask + qrcode 二维码直接生成在网页上的方式
### [email protected]("/", methods=["GET", "POST"])def dwpack(): """ 二维码生成 :return: """ try: id = request.args.get('package_id') byte_io = set_qrcode(url=&q原创 2019-01-10 20:48:44 · 1863 阅读 · 0 评论 -
pythnon 读取 apk, ipa 文件信息的简易方法
# -*- coding:utf-8 -*-import reimport zipfilefrom biplist import *from androguard.core.bytecodes import apkclass AnalyzePackage: def __init__(self): pass def get_android_d...原创 2019-01-10 20:39:01 · 409 阅读 · 0 评论 -
python argparse 的简单用法
#coding:utf-8import argparsedef main(): parser = argparse.ArgumentParser(description = "该文件仅做传参测试所用", epilog = "谢谢!") parser.add_argument('-b', '--bl', action = 'store_true', help = "添加该参...原创 2018-08-31 13:50:46 · 359 阅读 · 0 评论 -
python 拷贝目录内的所有文件及子目录到另外一个目录
import osimport shutilA = "Local_Script"B = "Local_back"#通过校验MD5 判断B内的文件与A 不同def get_MD5(file_path): files_md5 = os.popen('md5 %s' % file_path).read().strip() file_md5 = files_md5.repla...原创 2018-08-28 09:34:47 · 23394 阅读 · 5 评论 -
python json文件对比方法
#file1.json{ 'a':{ 'a1':'123' 'a2':'456' } 'b':{ 'b1':'acs' 'b2':'abc' }}#file1.json{ 'a':{ 'a1':'123' 'a2':'656' } 'c':...原创 2018-08-18 10:18:46 · 3907 阅读 · 1 评论 -
python 各种获取md5的方式
#使用python 库 求MD5import hashlib#求字符串MD5md5 = hashlib.md5('字符串').hexdigest()#求文件md5file = open('文件','rb')md5 = hashlib.md5(file.read())hexdigest()file.close()#python 利用mac/linex 终端命令求md5def ...原创 2018-08-18 10:01:30 · 12091 阅读 · 1 评论 -
python 执行终端/控制台命令
impo osos.system()os.popen().read().strip()#上面2种方法 是python 执行终端/控制台 命令的常见方法#os.system('ping www.baidu.com') 无返回值#ping = os.popen('pint www.baidu.com').read().strip() 返回输出结果#但 这个方法执行的时候 是无法交互...原创 2018-08-12 22:41:07 · 20853 阅读 · 0 评论 -
python 文件操作
import osimport shutildef get_file(path): for root,dirs,files in os.walk(path): for fs in files: file = os.path.join(root,fs) retrun file#上面的函数 返回了 目录 path 下的所有文件#扩展#...原创 2018-08-12 22:25:58 · 128 阅读 · 0 评论 -
python flask 跨域问题 解决方案
import urllib.parsefrom flask_cors import CORSfrom flask import Flask, request, make_response, sessiondef config_after_handler(app): CORS(app, suppors_credentials=True, resources={r'/*'})...原创 2019-06-22 18:40:08 · 1847 阅读 · 0 评论