示例#1
0
    def __init__(self, init_frame, name=None):
        self.frame = init_frame
        if name is None:
            name = 'Prompter'
        self.name = name

        self.title = tk.Label(self.frame, text=self.name.strip())
        self.title.config(Aspect.frame_opt())
        self.title.config(justify=tk.CENTER)
        self.title.grid(row=0, column=0, sticky=Aspect.def_sticky)

        self.history = list()

        self.text = list()
        self.label = tk.Label(self.frame)
        self.label.config(justify=tk.LEFT)
        self.label.config(Aspect.frame_opt())
        self.label.config(relief=tk.SUNKEN)
        self.feed(Prompter.V_LIM * Prompter.H_LIM * ' ')
        self.feed('{} Prompter initialization.'.format(self.name))
        self.label.grid(row=1, column=0, columnspan=5)
        Log.comment("Prompter '{}' initialized.".format(self.name))
示例#2
0
from gui import SimGUI
from log import Log
import time

start_time = time.time()

if __name__ == "__main__":
    Log.comment('Launching simulation.')
    SimGUI()
    stop_time = time.time()
    Log.comment('Simulation finished after {} seconds.'.format(stop_time -
                                                               start_time))