from SearchAlgorithms import NelderMead from numpy import * # figure out how to pass the function as an argument. A class & some interfaces or a la C++? def rosen(x): return ( 1 - x[0] )**2 + 100 * ( x[1] - x[0]**2 ) **2 a = NelderMead(rosen) a.Run() if raw_input('Enter p to plot, any other key to exit: ') == 'p': a.plot();