Skip to content

Instantly share code, notes, and snippets.

@libdx
Created October 8, 2019 11:56
Show Gist options
  • Save libdx/ca733dc63cf14bc5a26e1431448b6b5d to your computer and use it in GitHub Desktop.
Save libdx/ca733dc63cf14bc5a26e1431448b6b5d to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
from math import *
import sys
if __name__ == '__main__':
script = ' '.join(sys.argv[1:]).strip()
if len(script) > 0:
print(script, '=', end='')
result = eval(script)
print('', '\033[91m' + str(result) + '\033[0m')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment