sudo pip install pythonpy
# restart your shell for tab completion to take effect
py 'expression' ≅ python -c 'print(expression)'
Float Arithmetic
$ py '3 * 1.5'
4.5
Import any module automatically
$ py 'math.exp(1)'
2.71828182846
$ py 'random.random()'
0.103173957713
$ py 'datetime.datetime.now?'
Help on built-in function now:
now(...)
[tz] -> new datetime with tz's local day and time.
Lists are printed row by row
$ py 'range(3)'
0
1
2
$ py '[range(3)]'
[0, 1, 2]
py -x 'foo(x)' will apply foo to each line of input