Added function to step in pairs
This commit is contained in:
parent
2bb407c7da
commit
c3bed8df36
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
import svlgui
|
import svlgui
|
||||||
from threading import Event, Thread
|
from threading import Event, Thread
|
||||||
|
from itertools import tee, izip
|
||||||
import math
|
import math
|
||||||
import subprocess
|
import subprocess
|
||||||
import re
|
import re
|
||||||
|
|
@ -258,3 +259,10 @@ class RepeatTimer(Thread):
|
||||||
|
|
||||||
def cancel(self):
|
def cancel(self):
|
||||||
self.finished.set()
|
self.finished.set()
|
||||||
|
|
||||||
|
|
||||||
|
def pairwise(iterable):
|
||||||
|
"s -> (s0,s1), (s1,s2), (s2, s3), ..."
|
||||||
|
a, b = tee(iterable)
|
||||||
|
next(b, None)
|
||||||
|
return izip(a, b)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue