Private Sub AsyncFunction As PyWrapper
Dim Code As String = $"
import asyncio
async def AsyncFunction():
print("Hello!")
await asyncio.sleep(1) #Wait 1 second asynchronously
print("I hope you're having a nice day!")
"$
Return Py.RunCode("AsyncFunction", Array(), Code)
End Sub
Private Sub btnAsyncFunction_Click
Dim test As PyWrapper = AsyncFunction
test.Print
Wait For (test.Fetch) Complete (Result As PyWrapper)
Result.Print
Wait For (Py.Flush) Complete (Success As Boolean)
End Sub