#!C:\Python3.7 # -*- coding:utf-8 -*- import requests import base64 from urllib import parse def char2hex(s): h = "" for i in s: tem = (hex(ord(i))) h += tem print(h) h = str(h).replace("0x", "\\x") print(h) if __name__ == '__main__': print(base64.b64decode("PD9waHAgLy8gY3RmaHVie2YxZTVhZGYwZjliOGVkNTc0ODJlOThkY30K")) char2hex(" ") print("\x66\x6c\x61\x67\x5f\x69\x73\x5f\x68\x65\x72\x65\x2f\x66\x6c\x61\x67\x5f\x31\x37\x38\x36\x30\x32\x34\x34\x39\x33\x35\x36\x30\x31\x2e\x70\x68\x70") ##parse.quote()url编码 ##parse.unquote()url解码 # for i in range(128): # print(i,parse.quote(chr(i)))