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 base64 | |
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes | |
from cryptography.hazmat.primitives import padding | |
from cryptography.hazmat.backends import default_backend | |
from django.utils.encoding import force_bytes, force_text | |
SECRET_KEY = "hellomotherfucker" | |
value = force_bytes("12345678901234567890") | |
backend = default_backend() |
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 | |
@asyncio.coroutine | |
def hello(): | |
print("hello start") | |
ret = yield from asyncio.sleep(2) | |
print('hello end') | |
@asyncio.coroutine | |
def world(): |
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
# -*- coding:utf-8 -*- | |
import io | |
import re | |
class Counter: | |
def __init__(self, path): | |
""" | |
:param path: 文件路径 | |
""" | |
self.mapping = dict() |