python giving function as output? -


my python function supposed merely print variables multitude of functions single line, target.get_target_type outputting don't understand have no idea how fix it. expected output string literal of 'x' or 'y'.

the output:

target behavior:     <function target.get_target_type @ 0x102d89620> pursuer behavior:      x   mis-match 

from function:

def interaction_report(self):            print("target behavior: \t", target.get_target_type,  "pursuer behavior: \t", self.pursue_type, "\t", self.match_string) 

refers to:

def get_target_type(self):               return self.__target_type 

you need call function (e.g. target.get_target_type() instead of target.get_target_type. if don't call it, end reference callable function object itself.


Comments

Popular posts from this blog

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

javascript - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

java - Reading data from multiple zip files and combining them to one -