what the heck does this mean?

Gary Herron gherron at islandtraining.com
Thu Dec 13 04:42:38 EST 2007


katie smith wrote:
> Traceback (most recent call last):
>   File "C:\Python25\empire\Empire Strategy.pyw", line 322
>     Maty = Searched(number)
> TypeError: 'list' object is not callable
>  
> My list is NewMap1 =[0,0,0,0,0,0,2,0,2,2,3,2,0,0,0,0]
>  
> so Maty Searched(number is supposed to give me 0 when
>         Search = "NewMap"
>         number = 0
>         bignum = 1
>         bignumer = repr(bignum)
>         Searching = Search+bignumer
>         Searched = eval(Searching)
>         Maty = Searched[number]
>  
> instead i get that error whats up? i thought it is suppose to give me
> NewMap1(0).when I print it it works fine  and gives me the result 0
> but when I go to save the number as Maty-(randomletters) it keeps
> giving me the stupid error.
You're not telling us something important.   When I execute the
statements you give, I do indeed get 0 for the value of Maty, which is
what you expect -- so I see no problem.

But then in your next claim, you say "save the number as
Maty-(randomletters)".  What does that mean?  What Python statement are
you running?  What means "save"?  What is "randomletters"? 

The error you are getting is usually gotten by code that tries to treat
a variable containing a list as a function.  Example:

someList = [1,2,3]
someList(99)

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



Gary Herron



>  
> please help
>  
> Ps: rather than doing in your head making a test prgram to run exactly
> that might be better
>
> ------------------------------------------------------------------------
> Looking for last minute shopping deals? Find them fast with Yahoo!
> Search.
> <http://us.rd.yahoo.com/evt=51734/*http://tools.search.yahoo.com/newsearch/category.php?category=shopping>




More information about the Python-list mailing list