jstimers:通过Javascript实现setInterval和setTimeout的Python模块

时间:2021-05-02 12:52:06
【文件属性】:
文件名称:jstimers:通过Javascript实现setInterval和setTimeout的Python模块
文件大小:3KB
文件格式:ZIP
更新时间:2021-05-02 12:52:06
Python Python中的Javascript计时器 此模块允许Python用户在其代码中使用setTimeout()和setInterval() 。 我尚未实现setImmediate()因为重新创建功能的唯一方法是使clearImmediate()函数终止正在运行的线程。 杀死正在运行的线程本质上是不安全的,尽管有可能,但我认为实现它不是一个好主意。 在程序退出时将清除所有计时器。 用法 import jstimers from time import sleep ctr = 0 def increment (): global ctr ctr += 1 # Will increment ctr every 0.5 seconds. intervalID = jstimers . setInterval ( increment , 500 ) def test ( name
【文件预览】:
jstimers-master
----LICENSE(1KB)
----setup.py(323B)
----README.md(847B)
----jstimers()
--------__init__.py(3KB)

网友评论