main
This module is the 'launcher' module for the program. Every other module in the program originates from this location.
If the user requests a 'reset' from the Main GUI, the program controlling 'StateMachine' module destroys itself,
then, this module handles the launcing of a new instance of the program. This is made possible through the mutable result_container
object which we can pass to other modules for them to modify, then read the result later.
1""" 2This module is the 'launcher' module for the program. Every other module in the program originates from this 3location. 4 5If the user requests a 'reset' from the Main GUI, the program controlling 'StateMachine' module destroys itself, 6then, this module handles the launcing of a new instance of the program. This is made possible through the mutable `result_container` 7object which we can pass to other modules for them to modify, then read the result later. 8""" 9 10from app_logic import StateMachine 11 12 13def main(): 14 while 1: 15 # we pass in a list with one element, because lists in python are mutable items. so we can pass this 16 # into the StateMachine, modify the object and view the result when we are done with this instance 17 18 result_container = [0] 19 """init result container as mutable list with initial value of 0 (do not restart)""" 20 21 StateMachine(result_container) 22 """ 23 Startup a StateMachine instance to handle experiment logic. 24 """ 25 26 """ Match on the result to determine whether or not to restart program upon StateMachine return.""" 27 match result_container[0]: 28 case 0: 29 break 30 case 1: 31 continue 32 33 34if __name__ == "__main__": 35 main()
def
main():
14def main(): 15 while 1: 16 # we pass in a list with one element, because lists in python are mutable items. so we can pass this 17 # into the StateMachine, modify the object and view the result when we are done with this instance 18 19 result_container = [0] 20 """init result container as mutable list with initial value of 0 (do not restart)""" 21 22 StateMachine(result_container) 23 """ 24 Startup a StateMachine instance to handle experiment logic. 25 """ 26 27 """ Match on the result to determine whether or not to restart program upon StateMachine return.""" 28 match result_container[0]: 29 case 0: 30 break 31 case 1: 32 continue