Timeit

Steven D'Aprano steven at REMOVE.THIS.cybersource.com.au
Wed Feb 18 21:58:32 EST 2009


On Wed, 18 Feb 2009 17:35:16 -0800, cokofreedom wrote:

> I am really stuck trying to work out how to pass variables to timeit to
> allow me to run any of the examples...

setup = "from __main__ import example1, example2, example3"
Timer("example1()", setup)


In Python 2.6 you can also pass function objects directly.


-- 
Steven



More information about the Python-list mailing list