随笔分类 - python脚本
摘要:import requestsimport reurl = "https://www.777zw.net/2/2142/751765.html"with open('tunshixingkong.txt', 'a', encoding='utf8') as f: for i in range(500
阅读全文
摘要:import reimport requestsurl = 'http:afdfadfas'req = requests.get(url)num = re.findall("<p>Num is:(\d*?)</p>", req.text)list1 = []for i in num: list1.a
阅读全文
摘要:a = 'flag{8ozcvlpxhOonysqewjgfmrO0oporvzikhopyqnufcjwbgeamxds7iuojrpqtfgykOOxlwsbhn0OliOztgfocevbunyxjmkpws6tfhvnpdrqaaOOguzyewjkaibl0abulrfticqwepvxk
阅读全文
摘要:import socket# 创建 socket 对象serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)port = 9999# 绑定端口号serversocket.bind(('192.168.1.138', port)
阅读全文
摘要:import zipfileimport rarfile# from unrar import rarfileif __name__ == '__main__': file = zipfile.ZipFile("flag.zip") # file = rarfile.RarFile("pwd.rar
阅读全文
摘要:import base64import hashlibdef GetMd5(hash): hash1 = hashlib.md5(hash) return hash1.hexdigest()flag2 = ''with open('miwen.txt','r') as f: flag2 = f.re
阅读全文
摘要:"""@description: 凯撒密码@time: 2021-12-03@version: python3.9.6"""def CaesarEncode(crypto_str, shift): """ 凯撒加密 :param crypto_str: 要加密的明文 :param shift: 偏移
阅读全文
摘要:pip install socket#导入socket包import socketimport time#定义变量host,porthost = '192.168.1.137'port = 3000#进行socket连接obj = socket.socket()obj.connect((host,
阅读全文
摘要:import pymysqlconnection = pymysql.connect( host='', # 数据库地址 user='', # 数据库用户名 password='', # 数据库密码 db='', # 数据库名称 # charset = 'utf8 -- UTF-8 Unicode'
阅读全文
摘要:pip install xlwings 代码如下:import xlwings as xwfrom datetime import dateimport datetimeimport osapp = xw.App(visible=True, add_book=False)workbook = app
阅读全文
摘要:pip install xlwings代码如下:import osimport xlwings as xwsheetname = input('输入指定工作表:')filelist = os.listdir()app = xw.App(visible=True, add_book=False)for
阅读全文
摘要:pip install xlwings代码如下:import osimport xlwings as xwfilelist = os.listdir()app = xw.App(visible=True, add_book=False)for file in filelist: try: if os
阅读全文
摘要:代码如下:import itertoolsimport timeitems = '1234567890'password = itertools.product(items, repeat=6)start = time.time()with open('password6.txt', 'w', en
阅读全文
摘要:pip install pdf2docx代码如下:from pdf2docx import parseimport osfiles = os.listdir()for file in files: if os.path.splitext(file)[1] == '.pdf': parse(f'{os
阅读全文
摘要:安装wordcloud,jiebawordcloud去这里安装Python Extension Packages for Windows - Christoph Gohlke (uci.edu)代码如下import wordcloudimport jiebazhuci_list = ['的', '是
阅读全文