def test_one(self,benchmark): n=1 while(n<100): i = Interpreter() f = open('input.bas', 'r') for line in f: line = line.strip() split_line = line.split(" ") line_number = int(split_line[0]) i.add_line(line_number, split_line[1:]) i.run() f.close() n=n+1 benchmark(time.sleep, 0.000001)
def test_one(self, benchmark): n = 1 while (n < 100): i = Interpreter() f = open('input.bas', 'r') for line in f: line = line.strip() split_line = line.split(" ") line_number = int(split_line[0]) i.add_line(line_number, split_line[1:]) i.run() f.close() n = n + 1 benchmark(time.sleep, 0.000001)
def run_app(self, instance): i = Interpreter() line_number = 1 for cmd in self.command_stack: line = cmd.get_command() i.add_line(line_number, line) line_number = line_number + 1 i.run() output = i.get_output() variables = i.get_variables() self.comment.text = "" self.comment.insert_text('\n Output : \n') for value in output: self.comment.insert_text(' ' + str(value)+ '\n') self.comment.insert_text('\n Memory: \n') self.comment.insert_text(' Variable \t Value \n') for var in variables.keys(): value = ' \t' + var + ' \t\t\t ' + str(variables[var]) + '\n' self.comment.insert_text(' ' + str(value))