Python Forum

Full Version: TypeError: 'list' object is not callable
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am currently working on a python project regarding incremental strategy. So I have 2 python scripts, lets call them A and B. Script A contains the algorithm of the problem/task and script B contains the job information data. I want to call the list objects in script A to script B so that I can assign them to the job information data. But when I use script_a.listname() I get an error statement saying that list object is not callable. Can someone help me how to overcome this error? Thanks in advance.
Going by the description of the error when using script_a.listname() would indicate that listname is a list, to get the values of the list you would remove the () so it is not called.

>>> listname = [1, 2, 3, 4]
>>> listname()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'list' object is not callable
>>> listname
[1, 2, 3, 4]
>>>  
If that does not help you, please could you should show minimal code examples of script A & B in python code tags and the full traceback error in error tags.