monapi
Posts: 45
Joined: Tue Aug 07, 2018 7:53 am

picroft skill code

Mon Sep 03, 2018 12:24 pm

hi, this is a part of a code for picroft skill:

Code: Select all

def handle_command_intent(self, message):
	if message.data["command"].upper() == "BLINK":
		self.speak_dialog("ledblink")
the "data" and "command" and "speak" didn't define in the code
how does python found what data is? how about the other?

another problem that i have is in the code below:

Code: Select all

class iterable(object):
	def __init__(self, values):
		self.values = values
		self.location = 0
my question is why haven't location be put in the def arguments like below?

Code: Select all

def __init__(self, values, location):
and why a function like below should be define?

Code: Select all

def __iter__(self):
	return self 

Return to “Beginners”