一个python模块,用于在一系列命令上循环,重点是高度可配置性和可扩展性。
sequence的Python项目详细描述
一个python模块,用于在一系列命令上循环,重点是高度可配置性和可扩展性。
最新版本
此项目的最新版本位于:http://github.com/thomst/sequence。
安装
选项1:通过pip安装
pip install sequence
选项2:如果您下载了源代码
python setup.py install
文档
如何使用?
from sequence import Timer from sequence import Sequence from sequence import Cmd interval = 8 timer = Timer(interval) def f(x): print x cmd1 = Cmd(f, args=['cmd1'], stall=3) #stall the execution of cmd2 for 3 sec cmd2 = Cmd(f, args=['cmd2']) #just right now (depending on the order) cmd3 = Cmd(f, args=['cmd3'], delay=4) #soonest after 4 sec from loop-start #other options are available... sequence = Sequence(timer, [cmd1, cmd2, cmd3]) sequence.go()
报告错误
请在Github问题跟踪程序中报告错误: https://github.com/thomst/sequence/issues