[Python-checkins] python/nondist/sandbox/decimal/telco telco.py, 1.2, 1.3

facundobatista at users.sourceforge.net facundobatista at users.sourceforge.net
Tue Sep 7 05:07:58 CEST 2004


Update of /cvsroot/python/python/nondist/sandbox/decimal/telco
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17632

Modified Files:
	telco.py 
Log Message:
Modified test file name and added instructions if it's not in place

Index: telco.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/decimal/telco/telco.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- telco.py	29 Aug 2004 01:03:29 -0000	1.2
+++ telco.py	7 Sep 2004 03:07:41 -0000	1.3
@@ -1,4 +1,6 @@
-""" Telco Benchmark for measuring the performance of decimal calculations
+#-*- coding: UTF-8 -*-
+
+""" Telco Benchmark for measuring the performance of decimal calculations
 
 http://www2.hursley.ibm.com/decimal/telco.html
 http://www2.hursley.ibm.com/decimal/telcoSpec.html
@@ -17,7 +19,7 @@
 from struct import unpack
 from time import clock as time
 from decimal import *
-import sys
+import sys, os
 
 # To run the full test with 1,000,000 entries:  python telco.py full
 test = 'full' not in ' '.join(sys.argv[1:]).lower()
@@ -28,7 +30,10 @@
     print "  Time Rate | Price   Btax   Dtax  | Output"
     print "------------+----------------------+--------"
 else:
-    filename = "EXPON180.1E6"
+    filename = "expon180.1e6b"
+    if not os.access(filename, os.F_OK):
+        print "You must download and unzip the test file from: http://www2.hursley.ibm.com/decimal/expon180-1e6b.zip"
+        sys.exit(-1)
     expected = map(Decimal, "1004737.58 57628.30 25042.17".split())
 
 getcontext().rounding = ROUND_DOWN



More information about the Python-checkins mailing list