From 500451a682d4d6cf298bf4f199cbecde8ea91d69 Mon Sep 17 00:00:00 2001 From: Gabriel Dugny Date: Sun, 14 Jan 2018 21:40:26 +0100 Subject: [PATCH] Delete main.py --- src/main.py | 51 --------------------------------------------------- 1 file changed, 51 deletions(-) delete mode 100644 src/main.py diff --git a/src/main.py b/src/main.py deleted file mode 100644 index 1209e8f..0000000 --- a/src/main.py +++ /dev/null @@ -1,51 +0,0 @@ -# -*- coding: utf-8 -*- -import traceback -from os import system, name - -import logger_conf -from eval_global import ext_eval_global - -logger = logger_conf.Log.logger - - -def clear(): - system('cls' if name == 'nt' else '_clear') - - -variable_list = {} - -clear() -print("Welcome to the Calculator.\nUse \"exit\" to exit console or hit enter twice.") - -exit = False - -while True: - logger.debug("Variable dic: " + str(variable_list)) - exp = input("? ") - - # If the user just pressed enter - if exp == "": - # If it's the second time in a row, exit - if exit: - break - else: - exit = True - print("Press enter again to quit.") - continue - # If he has entered a not-empty expression, reset - else: - if exit: - exit = False - - # Try to evaluate and print.... - try: - res = ext_eval_global(exp, variable_list) - if res != "": - print(res) - # Catch the exception eval raise - except Exception as e: - print("Error: " + str(e)) - logger.error(str(e)) - logger.error(str(traceback.format_exc())) - -clear()