This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import time | |
import httpx | |
from flask import Flask, jsonify | |
app = Flask(__name__) | |
@app.route('/') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.19.2/axios.js"></script> | |
<script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.11/vue.common.dev.js"></script> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Point: | |
ref = None | |
operator = None | |
def __init__(self, x, y): | |
self._x = x | |
self._y = y | |
@property |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://www.v2ex.com/t/565534#reply8 | |
import random | |
import datetime | |
def genlog(): | |
ips = [] | |
for _ in range(100): | |
ips.append(".".join([ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Generator, List | |
import requests | |
import xlwt | |
from lxml import etree | |
base_url = "https://gaokao.chsi.com.cn/sch/search.do" | |
max_page = 137 | |
session = requests.Session() | |
session.headers["User-Agent"] = ("Mozilla/5.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import reduce | |
def rm(x, r): | |
_min = reduce(lambda x, y: x*y, x) | |
circulate, rest = divmod(r, _min) | |
r = common = 0 | |
for i in range(1, _min): | |
for j in x: | |
if i % j == 0: |