Changed the JSON generator to generate JSON that includes the correct answer for the expression.

This commit is contained in:
2020-04-13 00:05:17 -05:00
parent 1265f8ac3e
commit d1231b062f
6 changed files with 43 additions and 20 deletions
+5
View File
@@ -1,5 +1,6 @@
import token
import tokenizer
import expression
import calc_engine
import json
@@ -9,6 +10,10 @@ fileLocation = input('File Path to JSON: ')
#userInput = input('Enter your formula: ')
tokens = tokenizer.get_tokens_from_expression_string("2 + 6 / 2")
with open("expression.json", "r") as f:
j = json.load(f)
exp = expression.Expression(json.loads(j))
print(exp)
#results = calc_engine.calculate_results(tokens.copy())
#print(results)