[Scipy-svn] r4526 - trunk/scipy/sandbox/mkufunc/examples

scipy-svn@scip... scipy-svn@scip...
Wed Jul 2 20:18:05 CDT 2008


Author: ilan
Date: 2008-07-02 20:18:05 -0500 (Wed, 02 Jul 2008)
New Revision: 4526

Modified:
   trunk/scipy/sandbox/mkufunc/examples/primes.py
Log:
Added option s (to show C source) to prime.py

Modified: trunk/scipy/sandbox/mkufunc/examples/primes.py
===================================================================
--- trunk/scipy/sandbox/mkufunc/examples/primes.py	2008-07-03 01:11:42 UTC (rev 4525)
+++ trunk/scipy/sandbox/mkufunc/examples/primes.py	2008-07-03 01:18:05 UTC (rev 4526)
@@ -1,7 +1,13 @@
 #!/usr/bin/env python
 from math import sqrt
-import time
+import time, sys
 
+src = 0
+if len(sys.argv) == 2 and sys.argv[1] == 's':
+    src = 1
+    
+
+
 from mkufunc.api import mkufunc
 
 
@@ -21,7 +27,7 @@
 print 'Python: %.6f sec' % (time.time() - start_time)
 
 
-count_primes = mkufunc(int, src=len(sys.argv)-1)(count_primes)
+count_primes = mkufunc(int, src=src)(count_primes)
 
 
 start_time = time.time()



More information about the Scipy-svn mailing list