Skip to content

Instantly share code, notes, and snippets.

@Kwieeciol
Kwieeciol / file_polling.py
Last active February 18, 2025 16:42
Simple class to asynchronously poll from a file
from typing import Self, Awaitable
import os
import asyncio
import aiofiles # type: ignore # pip install aiofiles
from pathlib import Path
class FilePoll:
We couldn’t find that file to show.
import discord # type: ignore
from typing import ClassVar, Optional
from itertools import cycle
import asyncio
from async_timeout import timeout
class LoadingBar:
SLEEP_TIME: ClassVar[int] = 1
<!DOCTYPE HTML>
<html lang="pl">
<head>
<meta charset="utf-8">
<title>Odliczanie czasu</title>
<style>
body {
background-color: #111;
}