from sympy.abc import *

from flask import Flask, request
app = Flask(__name__)

@app.route('/code', methods=['GET', 'POST'])
def code():
    return str(eval(request.json['code']))

if __name__ == "__main__":
    app.run(debug=True, port=80)

from sympy.abc import *
from sympy.core.symbol import Symbol

while True:
    try:
        line = input('')
        print()
        if '=' in line:
            exec(line)
        else:
            _ = eval(line)
            print(_)
    except EOFError:
        continue
    except Exception as e:
        print('Error:', e)

Use local console input to drive the calc
Use local console input to drive the calc

  from sympy.abc import *
+ from sympy.core.symbol import Symbol
  
- from flask import Flask, request
- app = Flask(__name__)
+ while True:
+     try:
+         line = input('')
+         print()
+         if '=' in line:
+             exec(line)
+         else:
+             _ = eval(line)
+             print(_)
+     except EOFError:
+         continue
+     except Exception as e:
+         print('Error:', e)
  
- @app.route('/code', methods=['GET', 'POST'])
- def code():
-     return str(eval(request.json['code']))
- 
- if __name__ == "__main__":
-     app.run(debug=True, port=80)
- 
Use local console input to drive the calc
## Code Before:
from sympy.abc import *

from flask import Flask, request
app = Flask(__name__)

@app.route('/code', methods=['GET', 'POST'])
def code():
    return str(eval(request.json['code']))

if __name__ == "__main__":
    app.run(debug=True, port=80)

## Instruction:
Use local console input to drive the calc
## Code After:
from sympy.abc import *
from sympy.core.symbol import Symbol

while True:
    try:
        line = input('')
        print()
        if '=' in line:
            exec(line)
        else:
            _ = eval(line)
            print(_)
    except EOFError:
        continue
    except Exception as e:
        print('Error:', e)
