This is a function I've defined:
import sys
def hello():
print("hello")
class parser():
def parseSubcommand(self, name, function):
if name == sys.argv[1]:
result = function()
return(result)
def findArgument(self, name, function):
print("dummy") #not started working on findArgument yet
But when I try to call it like this:
parser().parseSubcommand(name="hello", function="hello")
I'm getting the error
function() TypeError: 'str' object is not callable