Skip to content

Instantly share code, notes, and snippets.

@melaku-z
Created August 22, 2018 12:48
Show Gist options
  • Save melaku-z/1282e74256375b9b2a86530a225d967c to your computer and use it in GitHub Desktop.
Save melaku-z/1282e74256375b9b2a86530a225d967c to your computer and use it in GitHub Desktop.
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')
except:
print('error')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment