TypeError: 'list' object is not callable
So I wrote this:
def find_orefolders(): # Finds all ore folders
ScanFolder = Region( ) # Sets area to search for folders
ScanFolder.
orefolders = list(ScanFolder
#gets locations of all folders and orders them by y position
sorted_orefolders = sorted(orefolders, key=by_y)
return sorted_orefolders
#print (sorted_orefolders)
#print (len(sorted_
def find_rocks(): # Finds all individual asteroids on screen
SelectRock = Region( )
try:
SelectRock.
foundRocks = list(SelectRock
sorted_foundRocks = sorted(foundRocks, key=by_y)
return sorted_foundRocks
except: FindFailed
return 0
def folder_opener(): # This function opens the needed amount of folders
try:
rockCount = len(find_rocks())
except: TypeError
rockCount = 0
while rockCount < 6:
orefolders = find_orefolders()
for m in orefolders(): # <-------- this is line 93 <------
# Finds the region in which to check the arrow orientation
foundFolder = Region(m)
arrow = foundFolder.
arrow = arrow.left(19)
#arrow.
if arrow.exists( ,1): # If the arrow is closed it opens it and restarts the while loop
click(m)
orefolders = find_orefolders()
break
rockCount = len(find_rocks())
if rockCount >= 6:
break
folder_opener() # <------this is line 107
When i run it i get this error message:
[error] Stopped
[error] An error occurs at line 107
[error] Error message: Traceback (most recent call last):
File "C:\Users\
folder_opener()
File "C:\Users\
for m in orefolders():
TypeError: 'list' object is not callable
I'm rather new with python and programming in general and i don't know how to get rid of this issue. I'm assuming it's something to do with the fact i'm getting the value from a function, since i wrote something almost identical to perform the same task, just without putting the code in functions. But the thing is supposed to check to see if an arrow by the folder is in a open or closed position.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- RaiMan
- Solved:
- Last query:
- Last reply: