Replies: 7 comments 12 replies
-
hi everyone |
Beta Was this translation helpful? Give feedback.
-
Hello to Python Community! I have started this traffic light program on my Pycharm and I have installed python-statemachine module also. Configuring all the required things, Pycharm is still dragging me to the same error saying, |
Beta Was this translation helpful? Give feedback.
-
Thanks Aashish.
Looks like you have a Python in a virtual env running as your Python
Interpreter on Pycharn. And you have installed the statemachine lib
globally.
Can you verify this? Maybe inside Pycharn you can see a list of available
libraries for the current interpreter.
Em qua., 31 de mar. de 2021 03:58, Aashish ***@***.***>
escreveu:
… [image: issue1]
<https://user-images.githubusercontent.com/67144641/113103074-74b9b800-921c-11eb-8f05-81e346861524.png>
Hello fgmacedo,
I have installed the library following this command, *pip install
python-statemachine* .
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#275 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACETLYXC5OWPANC3EADEZ3TGLB27ANCNFSM4ZDDXQZQ>
.
|
Beta Was this translation helpful? Give feedback.
-
I am using your statemachine class in a Python project. I'm trying to use inheritance. So I would do the following: class BasicSM(StateMachine): class FancierSM(BasicSM): class FanciestSM(BasicSM): The issue I'm having is that the transitions & states appear to "co-mingle" as class variables, so all transitions & states are present in all instances. So the actual state (self.current_state) is an instance variable, but the state definitions are all class variables. So how would allow for inheritance that is not visible to "sibling" classes? |
Beta Was this translation helpful? Give feedback.
-
I am trying to migrate a program written with a PLC (programmable logic controller) to Python using your library. There are a few things I am confused about how to implement here. First is with transitions, I would like one transition "state_completed" to complete the transition from one state to another depending on what state we are in. For example --> if I am in the "Starting" state, then "state_completed" should allow me transition to "Running" state. Similarly, if I am in "Stopping" state, then, state completed should allow me to move to "Stopped" state. In essence, this could be implemented like, "state_completed = State("whatever") if current_state == test_state". 2nd question and most important is on the callbacks. I would like to wait on the callbacks without blocking my program. For example: but not blocking the rest of my program. I have tried asyncio, but I cannot get the current_event_loop since there is no constructor. Please advise. |
Beta Was this translation helpful? Give feedback.
-
Hello, How can I execute a piece of code after transitioned to a State? For instance for the below code, when the state is 'Green', I would like to print('Green') and execute 'slowdown' to change the state from 'Green' to 'Yellow' automatically. (My Objective is a bit more complex than this, but if you can help me to understand this one, I can figure out the rest)
Would be happy if you can support me when available.. |
Beta Was this translation helpful? Give feedback.
-
Closing as this thread is stale for a while. |
Beta Was this translation helpful? Give feedback.
-
👋 Welcome!
We’re using Discussions as a place to connect with other members of our community. We hope that you:
build together 💪.
To get started, comment below with an introduction of yourself and tell us about what you do with this community.
Beta Was this translation helpful? Give feedback.
All reactions