from aiocsv import AsyncDictReader
import asyncio
import aiofiles
class DataPy:
@staticmethod
async def pizdectest(uid):
try:
# Open the CSV file in read mode without the newline parameter
async with aiofiles.open("data.csv", "r", encoding='utf-8') as csvfile:
reader = AsyncDictReader(csvfile)
# Asynchronously iterate over each row in the CSV file
async for row in reader:
print(row)
except Exception as e:
print(f"Ошибка: {e}")
# Run the asynchronous test function
asyncio.run(DataPy.pizdectest(6))