Hi all,
I was trying to learn how to profile a simple python program using hotshot, but am facing a weird error,
import sys
import hotshot
def main(argv):
for i in range(1,1000):
print i
if __name__ == "__main__":
prof = hotshot.Profile("hotshot_edi_stats")
b,c = prof.runcall(main(sys.argv))
prof.close()
and the output,
.
.
995
996
997
998
999
Traceback (most recent call last):
File "t.py", line 9, in <module>
b, c = prof.runcall(main(sys.argv))
File "/usr/lib/python2.5/hotshot/__init__.py", line 76, in runcall
return self._prof.runcall(func, args, kw)
TypeError: 'NoneType' object is not callable
Would anyone know why this happens? It looks to me like a problem with the hotshot profiler itself. Alternatively, do people have suggestions on other methods to profile python programs?
Thanks!