我有这个功能,我希望它能与我的观点一起工作,我该怎么做?如何使功能与我的观点一起运行
def PlaySound(self):
while(True):
if GPIO.input(Snare) == False:
os.system("path/to/the/sound")
return ("Is activated")
def view(request):
return render(request, "page.html")
你为什么不能直接叫它? –
我该怎么做? – Goun2
与其他功能相同:'PlaySound()'。 –