Poetry failing to run async python script by [tool.poetry.scripts] config #6580
-
|
Hi, I'm learning python asyncio module with a created project with Poetry. Poetry is able run the script when I run with Environment
pyproject.tomlmain.py |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
This is not a poetry problem. Basically, the code you've got in your name == "main" stanza, needs to be put into a function of it's own, so that it's run in an event loop. So put that code in a function (call it, say, run) then change the tool.poetry.scripts entry to point to the run function. |
Beta Was this translation helpful? Give feedback.
This is not a poetry problem.
Basically, the code you've got in your name == "main" stanza, needs to be put into a function of it's own, so that it's run in an event loop.
So put that code in a function (call it, say, run) then change the tool.poetry.scripts entry to point to the run function.