Skip to content

Instantly share code, notes, and snippets.

Last active December 15, 2015 22:32
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Using Python 3 as a screen-logging command-line calculator
#!/usr/bin/env python3
# Save this in your ~/bin as `cpy` and chmod +x
import code
import readline
import rlcompleter
# Directly import all the math functions
from math import *
print("Interactive Python 3 with 'from math import *'")
vars = globals()
readline.parse_and_bind("tab: complete")
shell = code.InteractiveConsole(vars)
Copy link

13rac1 commented Dec 15, 2015

List of functions available in math:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment