4 ms·
I still use the python repl in a terminal for my desktop calculator. Its a good choice since usually im already in the terminal anyways.
by jdeaton 5y ago
I still use the python repl in a terminal for my desktop calculator. Its a good choice since usually im already in the terminal anyways.
- savant_penguin 5y agoI also do the same although when I need fractions, having to type all the words to import and use the fraction module is a pain
- actually_a_dog 5y agoWhy not just save those words, and other commonly used words to a startup file? Then, you can just do export PYTHONSTARTUP=/home/savant_penguin/.python/startup.py and those things will be automatically loaded for you. (Edit: add that line to your .bashrc if you want to use it all or most of the time!) If you don't want them always loaded, but rather just for a "calculator mode," you can do something like alias pycalc='PYTHONSTARTUP=/home/savant_penguin/.python/ipython startup_calc_mode.py' If you use ipython, then you can take advantage of autocomplete and not have to type as much, too.
- colpabar 5y agoThank you for this!!! I use the repl all the time and had no idea I could do this.
- actually_a_dog 5y agoYou're quite welcome. After 7+ years of using Python professionally, I find I'm still discovering things I didn't know. And, I'm not referring to just new stuff that gets added, either. It's cool to pick up on these little things every once in a while.
- savant_penguin 5y agoThis is a really nice idea. Together with some from fractions import Fraction as F would be even better Thanks
- benhurmarcel 5y agoReminds me of this: https://krasjet.com/rnd.wlk/julia/ https://krasjet.com/rnd.wlk/julia/ Discussed here a couple of years ago: https://news.ycombinator.com/item?id=23414872 https://news.ycombinator.com/item?id=23414872
- warmwaffles 5y agoI use http://www.speedcrunch.org/ http://www.speedcrunch.org/ now. Very handy; quick to boot and use.
- lelanthran 5y agoI've been using clisp in the terminal since, well, forever. There's probably no advantage over Python, though.