MCPcopy Create free account
hub / github.com/bslatkin/effectivepython / run

Method run

example_code/item_078.py:104–111  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

102 self.loop = asyncio.new_event_loop()
103
104 def run(self):
105 asyncio.set_event_loop(self.loop)
106 with open(self.output_path, "wb") as self.output:
107 self.loop.run_forever()
108
109 # Run one final round of callbacks so the await on
110 # stop() in another event loop will be resolved.
111 self.loop.run_until_complete(asyncio.sleep(0))
112
113
114 print("Example 5")

Callers 1

item_078.pyFile · 0.45

Calls 1

openFunction · 0.85

Tested by

no test coverage detected