fsm - revert to previous state (newbie)

bruce epost2 at gmail.com
Tue Aug 16 05:39:35 EDT 2005


Hi all,

I`m working on a fsm that looks up its transitions in some
dictionaries. I`ve defined a default transition to an "error_state"
that is launched when there is no match of input_symbol, state etc in
other dicts. The error state just prints out that user_input was not
defined. After this I want to revert back to the state before the
error, so the user can try again. My solution now is to update the
value in the dictionary state_transitions whose key is "state_error",
inside the fsm loop. This is not very elegant I think. Does anyone know
of a better way?




More information about the Python-list mailing list