Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Calling pyscript from native python #669

Unanswered
patryksiwek asked this question in Q&A
Discussion options

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.

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /