First time here? Check out the FAQ!
answered 11 years ago
@profile is a function decorator, it can be only applied to a function or method. Wrap your code in a function and apply @profile to it, as shown in the examples of https://pypi.python.org/pypi/memory_profiler.
@profile