Calling pyscript from native python #669
Unanswered
patryksiwek
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone,
I'm currently facing an issue with Pyscript while trying to integrate it with a Python state machine. I’ve built a state machine in Python that relies on functionalities not supported by Pyscript. To work around this I've moved the state machine code to a separate Python file and imported it natively following the guidelines from the "Importing" page in the wiki. So far, Pyscript script successfully gathers triggers, converts them to state machine events, and cyclically services the machine. This part works flawlessly.
The problem shows when I try to invoke callbacks from the state machine itself that modify entities via Pyscript during state transitions. I can’t seem to import Pyscript scripts into the native Python code. While the "Importing" wiki page explains how to import native Python into Pyscript, the reverse way doesn’t appear to be working. Whenever I attempt it, I encounter an error in the logs stating that the module cannot be found.
I’ve also tried passing a list of callback functions from Pyscript to the state machine during its creation. Unfortunately, this doesn’t work either. The logs don’t show any output when I try to print log and also I get the following warning:
RuntimeWarning: coroutine 'EvalFuncVar.__call__' was never awaited
At this point, I’m completely stuck and would really appreciate any advice or suggestions on how to move forward.
Beta Was this translation helpful? Give feedback.
All reactions