Re: how to improve simple python shell script (to compile list of files)

2005-10-15 Thread Maarten van Reeuwijk
Jari Aalto wrote:

> 
> [Keep CC, thank you]
> 
> Please suggest comments how can I make this script to work
> from bash. Also how can I skip better the [0] argument from
> command line without hte extra variable i?

Didn't check, but something like this?

#!/bin/python
import os, sys, py_compile;
i = 0;
for arg in sys.argv:
  file  = os.path.basename(arg);
  dir   = os.path.dirname(arg);
  i += 1;
  if i > 1  and os.path.exists(dir):
  os.chdir(dir);
 print "compiling %s\n" % (file);
 py_compile.compile(file);

-- 
===========
Maarten van Reeuwijkdept. of Multiscale Physics
Phd student Faculty of Applied Sciences
maarten.ws.tn.tudelft.nl Delft University of Technology
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: About alternatives to Matlab

2006-11-17 Thread Maarten van Reeuwijk
sturlamolden wrote:

> Sorry Mathworks, I have used your product for years, but you cannot
> compete with NumPy.

Funny. I went exactly the other way. Had a full OO postprocessing library
for Python/Scipy/HDF etc which worked brilliantly. Then changed to a 64 bit
machine and spent three days trying to install all the additional libraries
that I had become dependent on over the year. In the end, I gave up
completely frustrated (something to do with a Fortran compiler in
combination with SciPy or something). Then I tried MATLAB  and was
completely delighted that there was a program with all MY batteries
included :-).

BTW, I have the impression that MATLAB and SciPy have about the same
performance.

Cheers, Maarten
-- 
===
Maarten van Reeuwijkdept. of Multiscale Physics
Phd student Faculty of Applied Sciences
maarten.vanreeuwijk.net  Delft University of Technology
-- 
http://mail.python.org/mailman/listinfo/python-list