简体   繁体   English

在Python中使用Android的“ Timer.schedule”

[英]Using Android's `Timer.schedule` in Python

Could someone explain how to use the Timer.schedule - that is used for scheduling tasks - in Python ? 有人可以解释如何在Python中使用Timer.schedule (用于计划任务)吗?

Note that Python's time.sleep will not work in Android. 请注意,Python的time.sleep在Android中不起作用。

time.sleep does work on the Android Scripting Environment (at least for the last 5 releases or so). time.sleep确实可以在Android脚本环境中使用(至少在最近的5个发行版中)。 I've just tested it on the interpreter console. 我刚刚在解释器控制台上对其进行了测试。

On the other hand, some dialogs (like makeToast, for instance) won't hold the script execution while they're being displayed. 另一方面,某些对话框(例如makeToast)在显示时将不保存脚本执行。 Perhaps that's why you may be feeling time.sleep doesn't work. 也许这就是为什么您可能会感觉到时间的原因。睡眠不起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM