ctrl+c/v 系列代码

用来dump内存数据后,查找关键信息 while true;do command;sleep 2;done [codesyntax lang=”php”] # _*_coding:utf-8 _*_ import sys import re reload(sys) sys.setdefaultencoding(‘utf8′) def numberChange(path): f = open(path,’r’) s = f.read() for i in [“utf8″,”gb2312”]: try: data = s.decode(i) break except: pass number = re.compile(ur'(TOKEN=[a-zA-Z0-9]{32})’) pattern = re.compile(number) all = pattern.finda […]

查看全部


把python程序转化成exe 在windows上运行

1.下载python,这了选择python3.6,然后安装配置好环境变量在环境变量里添加python的根目录和python目录下Scripts目录即可,方便使用。https://www.python.org/downloads/ 2.下载pyinstaller 注意对应的python版本,解压后放到python目录下http://www.pyinstaller.org/downloads.html 3.下载pywin32,注意对应的python版本,然后安装https://sourceforge.net/projects/pywin32/files/pywin32/Build%20221/ 4.在python目录下的Scripts目录里执行python pywin32_postinstall.py -install 5.在pyinstaller目录(第2步总被解压到python目录中)下执 […]

查看全部


Python中使用socket通讯

未缩进—- Server.py: #coding:utf-8 import os import socket import subprocess HOST = ‘192.168.145.145’ PORT = 50008 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind((HOST, PORT)) s.listen(5) while True: conn, addr = s.accept() print ‘Connected by’, addr while True: command = conn.recv(1024) if not command: break if command == ‘quit’: break #data = os.popen(command).read() result = sub […]

查看全部


Python 生成随机数For work

python脚本.py: from random import Random i=0 def random_str(randomlength=30): str = ” chars = ‘AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz0123456789_’ length = len(chars) – 1 random = Random() for i in range(randomlength): str+=chars[random.randint(0, length)] return str while (i<500): i=i+1 print ‘o’+random_str()   linux下执行: python python脚本.py > python随机数.txt

查看全部