list() object not callable 3.5
The list() function to turn strings/tuples into a list does not seem to work in pythonista with 3.5. I get the error: “‘list’ object is not callable. But run the same script in 2.7 it works. Googling around I didn’t find anything to indicate that list has depreciated.
Here’s an example:
myarray = list('1abcdefg')
It works in 2.7 but not 3.5. Anyone have an idea on how to convert to a list in pythonista 3.5? Thanks!
The error message means that you are trying to call a list object, and not the
listclass. This usually happens when you accidentally store a list under the variable name
list = [1, 2, 3], which hides Python's standard
listclass. To check if that's the issue, type
listin the console to show the current value of the
listvariable. By default it will be
<class 'list'>, but if you overwrote it, you'll get something like
[1, 2, 3].
To fix this, run
del list, this removes your own
listvariable and makes the built-in
listvisible again. Or simply restart Pythonista.
I appreciate your answer! Force closing and restarting did the trick. I’ve been downloading tutorial scripts and things from online to help me learn UI module better and I must of have found one that goofed it up. I didn’t realize it would overwrite it from one script to another. Anyway, again, thanks! Cheers!