misszm

以前以为错过也很美, 想在很后悔

2019年5月10日

python 生成 树状结构

摘要: 树状结构: 字典里只有一个键值对, key 为根, 值为一个列表, 列表里的某个或多个元素可以再进行分支(分支还是列表) 比如: 邮件的发件人, 收件人, 转发关系树状结构 阅读全文

posted @ 2019-05-10 12:34 宋喜阳 阅读(1832) 评论(0) 推荐(0) 编辑

2019年5月6日

python3 FastDFS 客户端bug

摘要: python客户端进行操作的时候, 目前发现两个bug: 找到自己使用的python解释器命令 (which python) whereis python是显示所有安装的python 解释器 1. 第一个连接bug: lib/python3.7/site-packages/fdfs_client/c 阅读全文

posted @ 2019-05-06 22:25 宋喜阳 阅读(669) 评论(0) 推荐(0) 编辑

2019年5月4日

u盘 安装 centOS 7

摘要: 实际上, 对于服务器的安装, 最好是能够远程批量安装(可能有些难度, 不是专业运维) 镜像下载地址: http://59.80.44.49/isoredirect.centos.org/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1810.iso # (不同的下 阅读全文

posted @ 2019-05-04 21:41 宋喜阳 阅读(424) 评论(0) 推荐(0) 编辑

cent OS 7 安装谷歌浏览器

摘要: 我直接写一个shell 脚本, install_google.sh, bash 命令直接运行就好, 脚本内容如下: (切换root用户执行) set -e # 出错即退出 echo " [google-chrome] name=google-chrome baseurl=http://dl.goog 阅读全文

posted @ 2019-05-04 19:05 宋喜阳 阅读(838) 评论(0) 推荐(0) 编辑

2019年4月21日

python ftp 上传文件

摘要: # -*- coding: utf-8 -*- # 本地bytes 数据上报服务器同时创建文件from ftplib import FTP import time, _io from constant import ftp_host, ftp_port, ftp_pw, ftp_user, ftp_ 阅读全文

posted @ 2019-04-21 18:01 宋喜阳 阅读(629) 评论(0) 推荐(0) 编辑

2019年4月20日

python psycopg2 连接pg 建立连接池

摘要: # -*- coding: utf-8 -*-from psycopg2.pool import ThreadedConnectionPool,SimpleConnectionPool,PersistentConnectionPool from constant import pg_name, pg 阅读全文

posted @ 2019-04-20 23:09 宋喜阳 阅读(3106) 评论(0) 推荐(0) 编辑

2019年4月17日

python 字典 拼接SQL语句

摘要: def gen_sql(table_name, data): """ :param table_name: 表名称 :param data: 字典对象 key为字段(要与数据库字段一样), value为插入值 :return: 拼接好的sql语句 """ fields = list() values 阅读全文

posted @ 2019-04-17 21:03 宋喜阳 阅读(3214) 评论(0) 推荐(0) 编辑

2019年4月11日

python websocket(tornado) 客户端连接

摘要: # -*- coding: utf-8 -*-import jsonimport websocketimport _thread as thread # try:# import thread# except ImportError:# import _thread as thread def on 阅读全文

posted @ 2019-04-11 14:31 宋喜阳 阅读(7844) 评论(0) 推荐(0) 编辑

2019年4月2日

python AES加密 ECB PKCS5

摘要: class AesEbc16: # 按块的大小, 一块一块的加密, 明文和密文长度一样 def __init__(self): self.key = b"123qweqqqwerqwer" # 加密和解密用同一个秘钥, 长度为 每块的长度 self.mode = AES.MODE_ECB # ECB 阅读全文

posted @ 2019-04-02 22:25 宋喜阳 阅读(1457) 评论(0) 推荐(0) 编辑

python 字符串 转 bit, bitarray 异或加密

摘要: Python中异或加密要将str 转为 bitarray, 提示: int类型和纯数字的字符串也可以异或处理, 可能更方便 from bitarray import bitarray def str2bitarray(msg): # msg 为str msg_2 = "" # 转为1010拼接成字符 阅读全文

posted @ 2019-04-02 13:19 宋喜阳 阅读(6103) 评论(0) 推荐(0) 编辑

导航