Hi I'm trying to call an asynchronous function in python using the new pybridge framework but I can't get it to work.
I attach part of my code and an example project, greetings
P.S. Congratulations to Erel for the great framework he's made
I attach part of my code and an example project, greetings
Python code:
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
P.S. Congratulations to Erel for the great framework he's made