Newbie import probelm..

yab matthew.warren at
Tue Feb 3 13:15:41 CET 2004


Why does this work when I type it in a t the interpreter prompt;

>>>class invoker:
	def ex(self,cmd):
		print 'would do ', cmd

would do  test

but if I save invoker as in a dir that is in sys.path and import it the follwoing happens;

>>> import invoker
>>> x=invoker()
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: 'module' object is not callable

More information about the Python-list mailing list