https://docs.python.org/3/howto/logging-cookbook.html#logging-to-a-single-file-from-multiple-processes
https://medium.com/bigdatarepublic/advanced-pandas-optimize-speed-and-memory-a654b53be6c2
import asyncio, nest_asyncio nest_asyncio.apply() # Fix asyncio bug in IPython (RuntimeError: This event loop is already running) async def example1(): # 定義一個中間會被中斷的協程 print("Start example1 coroutin.") await asyncio.sleep(1) # 中斷協程一秒 print("Finish example1 coroutin.") async def example2(): # 定義一個協程 print("Start example2 coroutin.") # do some process... print("Finish example2 coroutin.") tasks = [ asyncio.ensure_future(example1()), asyncio.ensure_future(example2()), ] loop = asyncio.get_event_loop() loop.run_until_complete(asyncio.wait(tasks))
There was an error while loading. Please reload this page.