Skip to content

Instantly share code, notes, and snippets.

@melaku-z
melaku-z / Console_Calculator.py
Created August 22, 2018 12:48
simple python script that requires no installation or setting up. Just run it to get a command line that executes math calculations like "cos(2.4*pi)". I tried to emulate the matlab command line, but with faster start up.
from math import *
while True:
inputText = input('>> ')
try:
Result = eval(inputText)
print(Result)
except:
try:
exec(inputText)
print('executed')