Posts: 4,655
Threads: 1,498
Joined: Sep 2016
a simple calculator command in python is rather easy to do. the eval() built-in function makes it nearly trivial. so what about one that does calculations like the decimal module does, but without requiring the expressions code any decimal functions (so a user can do: "calc 0.1+0.1+0.1-0.3" and get 0.0 or 0)?
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,655
Threads: 1,498
Joined: Sep 2016
May-19-2018, 02:49 AM
(This post was last modified: May-19-2018, 02:49 AM by Skaperen.)
a "calc" command is not a "python script in one line" command. let them use "python -c" if that's what they need. i used to do a lot of commands like "python -c 'import math;print math.sqrt(57600)'" for my electrical calculations until i threw together a command named "sqrt". fyi, the "calc" command i made does "from math import *" so i can do a plain "sqrt()", and others like it. maybe i should do that with "cmath", too. and maybe "decimal". oh wait, i wanted "decalc" to just do everything in decimal.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.