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://github.com/pyrogram/tgcrypto | |
import os | |
import time | |
import tgcrypto | |
def fmt(d, s): | |
return f"{len(d) / (time.time() - s) / 1024 / 1024 :.2f} MB/s" |
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 | |
from concurrent.futures import ThreadPoolExecutor | |
async def ainput(prompt: str = "") -> str: | |
with ThreadPoolExecutor(1, "AsyncInput") as executor: | |
return await asyncio.get_event_loop().run_in_executor(executor, input, prompt) | |
async def main(): |
OlderNewer