From 6cef98189fb54594250fb60d0a8640257bec41d2 Mon Sep 17 00:00:00 2001 From: DanielPandey <72138244+DanielPandey@users.noreply.github.com> Date: Wed, 30 Sep 2020 08:28:32 -0400 Subject: [PATCH 1/5] Updated and Improved the Docs --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4de1607..f771a4e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -calculator +calculator in python ========== -Calculator implemented in Python \ No newline at end of file +Calculator implemented in Python +This calculator is created in python.Through which you will learn the bacis of the operators, if else and many things. From 3f7b4b4a9078b9a5015b4183ea900b2cb9a6d37c Mon Sep 17 00:00:00 2001 From: DanielPandey <72138244+DanielPandey@users.noreply.github.com> Date: Wed, 30 Sep 2020 08:34:48 -0400 Subject: [PATCH 2/5] Improved and Updated DOCS --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index f771a4e..955d845 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,6 @@ calculator in python Calculator implemented in Python This calculator is created in python.Through which you will learn the bacis of the operators, if else and many things. + +Not only the bacis but you will be learning the ERROR HANDLING, OOPs, and many more. +the best thing about this calculator is that you only have to give the expression which means that not only calculation between two numbers but you can give as much as operators and operands as you want to give as a input From 6db31a250b481db6110b97e18375b6070a49da15 Mon Sep 17 00:00:00 2001 From: DanielPandey <72138244+DanielPandey@users.noreply.github.com> Date: Wed, 30 Sep 2020 08:36:50 -0400 Subject: [PATCH 3/5] Updated Calculator --- calculator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/calculator.py b/calculator.py index 205adc7..b945487 100755 --- a/calculator.py +++ b/calculator.py @@ -15,7 +15,7 @@ def printTokens(tokens): expressions = '' while iterator != len(tokens): if tokens[iterator].getType() == TokenType.NUMBER_TOKEN: - print "Number:\t\t", + print "The Number = \t\t", print tokens[iterator].getValue() expressions += str(tokens[iterator].getValue()) + ' ' elif tokens[iterator].getType() == TokenType.OPERATOR_TOKEN: From d9307629ec6cb4fe2e9a222f6d56d2d9bece7016 Mon Sep 17 00:00:00 2001 From: DanielPandey <72138244+DanielPandey@users.noreply.github.com> Date: Wed, 30 Sep 2020 08:42:20 -0400 Subject: [PATCH 4/5] Improved Calculator.py by making it error free because line 65 was throwing error in my computer --- calculator.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/calculator.py b/calculator.py index b945487..fa068f0 100755 --- a/calculator.py +++ b/calculator.py @@ -62,4 +62,7 @@ def main(): if __name__ == '__main__': - main() + try: + main() + except Exception as e: + pass From 5d54d1d6ad693dca03cdb28bb3aa3ed46bac50e5 Mon Sep 17 00:00:00 2001 From: DanielPandey <72138244+DanielPandey@users.noreply.github.com> Date: Wed, 30 Sep 2020 08:44:46 -0400 Subject: [PATCH 5/5] Improved scanner.py --- scanner.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scanner.py b/scanner.py index 258fc4a..aea703c 100755 --- a/scanner.py +++ b/scanner.py @@ -2,8 +2,11 @@ #Comp 141, Homework 7 #Python Calculator (calculator.py) -from calcExceptions import CalcExceptions -import token +try: + from calcExceptions import CalcExceptions + import token +except Exception as e: + pass #Scanner Class #Takes in user input and splits into tokens