Python 3 — Run async function synchronously
Problem How do we run an asynchronous function in a synchronous script? Python’s await async syntax can be a real life-saver when it comes to running highly concurrent code in a performant manner. However, sometimes we just want to call an asynchronous function synchronously. Maybe we have a small application where performance is not a big issue, or we just want to reuse some async functions in an experimental script. In such situations we do not want to rewrite the whole implementation to use only an asynchronous approach....