From: Simon Ruderich Date: Sun, 17 Jun 2018 06:22:20 +0000 (+0200) Subject: shell/bin/calc: convert to python3 X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=c5b5704153f503f37d7b89aadc0d047c60db1b37;p=config%2Fdotfiles.git shell/bin/calc: convert to python3 --- 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