import Robot import Container robot = Robot.MotorizedPlatform def translation(arg): try: callable = getattr(robot,arg) possible=True except AttributeError: print('ERROR') possible=False if possible: callable() x="" while x!="q": x=input('command : ') if x=="help": print(robot.__dict__) else: translation(x)