Dear list,
I'm writing very simple state machine library, like this:
_state = None
def set_state(state):
global _state
_state = state
def get_state():
print _surface
but I hate to use global variable. So, please, is there a better way
of doing this? All I want is that a user has to type as little as
possible, like:
from state_machine import *
set_state(3)
get_state()
I.e., nothing like:
import state_machine
my_machine = state_machine.new_machine()
my_machine.set_state(3)
my_machine.get_state()
Thanks, in advance!
--
http://mail.python.org/mailman/listinfo/python-list