It looks like your algorithm really does iterate over all values for six variables and do lots of math.. then you can't do any better than implementing the inner loop in C. It does look like you have some functions that are being called that are also in python, and it would be interesting to see if just one of those was the culprit. If so, you might be able to replace just one of those calls with something faster.
I'm no expert, but I have used swig once or twice, I might be able to help. What do you think? If you are going through all the data just to find a minimum or something, then you might be able to get away with not visiting all of the values of all six variables. Some sort of gradient descent minimization is probably already out there written in C ready to be used. -Jim On 5/18/05, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2005-05-18, Luis P. Mendes <[EMAIL PROTECTED]> wrote: > > > I have a 1000 line python script that takes many hours to > > finish. It is running with six inside 'for' loops. > -- http://mail.python.org/mailman/listinfo/python-list