import CompuCell #notice importing CompuCell to main script has to be done after call to getCoreSimulationObjects() #import CompuCellSetup CompuCellSetup.initializeSimulationObjects(sim, simthread) steppableRegistry = CompuCellSetup.getSteppableRegistry() CompuCellSetup.mainLoop( sim, simthread, steppableRegistry ) # main loop - simulation is invoked inside this function except IndentationError, e: if CompuCellSetup.simulationObjectsCreated: sim.finish() traceback_message = traceback.format_exc() print traceback_message import PlayerPython simthread = PlayerPython.getSimthreadBasePtr() simthread.handleErrorMessage("Python Indentation Error", traceback_message) except SyntaxError, e: if CompuCellSetup.simulationObjectsCreated: sim.finish() traceback_message = traceback.format_exc() print traceback_message import PlayerPython simthread = PlayerPython.getSimthreadBasePtr() simthread.handleErrorMessage("Python Syntax Error", traceback_message) except IOError, e: if CompuCellSetup.simulationObjectsCreated: sim.finish() traceback_message = traceback.format_exc() print traceback_message import PlayerPython
else: sim,simthread = CompuCellSetup.getCoreSimulationObjects() import CompuCell #notice importing CompuCell to main script has to be done after call to getCoreSimulationObjects() #import CompuCellSetup CompuCellSetup.initializeSimulationObjects(sim,simthread) steppableRegistry = CompuCellSetup.getSteppableRegistry() CompuCellSetup.mainLoop(sim,simthread,steppableRegistry) # main loop - simulation is invoked inside this function except IndentationError,e: if CompuCellSetup.simulationObjectsCreated: sim.finish() traceback_message=traceback.format_exc() print traceback_message import PlayerPython simthread=PlayerPython.getSimthreadBasePtr() simthread.handleErrorMessage("Python Indentation Error",traceback_message) except SyntaxError,e: if CompuCellSetup.simulationObjectsCreated: sim.finish() traceback_message=traceback.format_exc() print traceback_message import PlayerPython simthread=PlayerPython.getSimthreadBasePtr() simthread.handleErrorMessage("Python Syntax Error",traceback_message) except IOError,e: if CompuCellSetup.simulationObjectsCreated: sim.finish() traceback_message=traceback.format_exc() print traceback_message import PlayerPython