2024-05-14 20:28:11 发布
网友
我有这个功能,我想让它和我的观点一致,我怎么能做到呢?在
def PlaySound(self): while(True): if GPIO.input(Snare) == False: os.system("path/to/the/sound") return ("Is activated")
如果PlaySound不是类的方法,那么就不需要self。使用def PlaySound():。在
PlaySound
self
def PlaySound():
def PlaySound(): ...
然后,在返回响应之前,可以在视图中调用该方法。在
如果
PlaySound
不是类的方法,那么就不需要self
。使用def PlaySound():
。在然后,在返回响应之前,可以在视图中调用该方法。在
^{pr2}$相关问题 更多 >
编程相关推荐