I'm new to coroutines in python but I know in lua you would do this to create one
coroutine.wrap(function()
while true do
end
end)()
But I dont know how I would do this python.
I tried using this code which included a function from the slp_coroutine library which didnt work
import slp_coroutine
def test():
while True:
print("hi")
time.sleep(3)
r = slp_coroutine.await_coroutine(test())
and I also tried this and it also didnt work.
async def test():
while True:
print("hi")
await asyncio.sleep(3)
asyncio.run(test())