Skip to content

Instantly share code, notes, and snippets.

@john100ster
john100ster / get_ip.py
Last active May 27, 2021 00:12
[解析文件中的 ip 地址] #python
# -*- coding:utf-8 -*-
import re
import time
def mail_log(file_path):
global count
log = open(file_path, 'r')
C = r'\.'.join([r'\d{1,3}']*4)
find = re.compile(C)
@john100ster
john100ster / login_rerquired.py
Last active May 25, 2021 02:54
[python flask token 校验 装饰器]#flask
from flask import request
from app.libs.token_auth import verify_auth_token
def login_required(fun):
def wrapper(*args, **kwargs):
headers = request.headers
auth = headers.get("Authorization")
verify_result = verify_auth_token(auth.split(" ")[1])