import asyncioimport aiofilesasync def read_file(filePath): while True: try: async with aiofiles.open(filePath,mode='r') as f: content=await f.read() print(f'{content}') except FileNotFoundError: print(f'{filePath} is noexist') except Exception as e: print(f'{e}') await asyncio.sleep(1)async def main(): filepath='data.txt' task=await read_file(filepath) await taskasyncio.run(main())