随笔分类 - Python
摘要:#!/usr/bin/env python # _*_coding:utf-8_*_ import OpenSSL from OpenSSL import crypto from dateutil import parser def get_cert_detail(cert_file): """ 获取证书信息 :param cert_file: :return: """ cert = crypto
阅读全文
摘要:UUID是128位的全局唯一标识符,通常由32字节的字符串表示。 它可以保证时间和空间的唯一性,也称为GUID,全称为: UUID Universally unique IDentifier python 中叫UUID GUID Globally Unique IDentifier C#中叫GUID
阅读全文
摘要:import random import string print(string.ascii_letters) # 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' print(string.ascii_lowercase) # 'abcdefghijklmnopqrstuvwxyz' print(string.ascii_...
阅读全文
摘要:UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-2: ordinal not in range(128) import sys print (sys.getdefaultencoding()) # asc
阅读全文
摘要:virtualenv 用来创建一套"隔离"的python 运行环境。 virtualenv 优点: 使不同应用开发环境独立 环境升级不影响其他应用,也不会影响全局的python环境。 可以防止系统中出现包管理混乱和版本的冲突。 安装: # 安装 pip install virtualenv # 创建
阅读全文
摘要:密码与通信 密码技术是一门历史悠久的技术。信息传播离不开加密与解密。密码技术的用途主要源于两个方面,加密/解密和签名/验签。 pip install pycrypto RSA 密码算法与签名 RSA是一种公钥密码算法,RSA的密文是对代码明文的数字E次方求mod N的结果。也就是将明文和自己做E次乘
阅读全文
摘要:# 日期格式: %a 星期几的简写 %A 星期几的全称 %b 月分的简写 %B 月份的全称 %c 标准的日期的时间串 %C 年份的后两位数字 %d 十进制表示的每月的第几天 %D 月/天/年 %e 在两字符域中,十进制表示的每月的第几天 %F 年-月-日 %g 年份的后两位数字,使用基于周的年 %G
阅读全文
摘要:import sys, os import socket, struct, fcntl import six import psutil def get_ip(iface="enp0s3"): sock = socket.socket(socket.AF_INET, socket.SOCK_STRE
阅读全文
摘要:${PROJECT_NAME} - 当前Project名称; (the name of the current project. ) ${NAME} -创建文件的对话框中制定的文件名; (the name of the new file which you specify in the New Fi
阅读全文
摘要:pip 安装: 安装特定版本的package,通过使用== ,>=,<=,>,< 来指定一个版本号 pip install apscheduler==3.0.5 升级包,到当前最新的版本,可以使用 -U或者 --upgrade pip install -U apscheduler 卸载包 pip u
阅读全文
摘要:ubuntu:apt-get install gcc zlib* openssl openssl-dev debian :apt -y install gcc make zlib1g-dev libffi-dev libssl-dev libffi-dev libssl-dev Centos :yum -y install gcc zlib* openssl openssl-devel ta...
阅读全文

浙公网安备 33010602011771号