-
-
Save 13rac1/ad95acfd806098e75e65 to your computer and use it in GitHub Desktop.
Using Python 3 as a screen-logging command-line calculator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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() | |
vars.update(locals()) | |
readline.set_completer(rlcompleter.Completer(vars).complete) | |
readline.parse_and_bind("tab: complete") | |
shell = code.InteractiveConsole(vars) | |
shell.interact() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
List of functions available in
math
: https://docs.python.org/3/library/math.html