X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=shell%2Fbin%2Fcalc;h=798050922eae95a8325d94b6df6bc7a9fa2bd3a8;hb=dab786b7775766e62acd77e57794d8425a5e6e35;hp=ea3cbd38254bbb4f077b6ac0a238f0a9a7ead69a;hpb=dcd322819bcff59f34bde4a4a82e4d20afb1b1d6;p=config%2Fdotfiles.git diff --git a/shell/bin/calc b/shell/bin/calc index ea3cbd3..7980509 100755 --- a/shell/bin/calc +++ b/shell/bin/calc @@ -18,7 +18,7 @@ set -eu -exec python -i -c ' +exec python3 -i -c ' # Math functions. from math import * @@ -33,7 +33,7 @@ def binom(n,k): # Convert number to scientific notation (e.g. 5e6). def s(x): - print "%e" % x + print("%e" % x) # Time/Date functions. @@ -41,9 +41,9 @@ import time # Convert time in seconds since epoch to readable string. def stime(seconds): - print time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(seconds)) + print(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(seconds))) -print "Welcome to the ultimate calculator."' +print("Welcome to the ultimate calculator.")' # vim: ft=python