Skip to content

Instantly share code, notes, and snippets.

@miccoli
Created November 6, 2015 12:54
Show Gist options
  • Save miccoli/3df5e84624b50cb070de to your computer and use it in GitHub Desktop.
Save miccoli/3df5e84624b50cb070de to your computer and use it in GitHub Desktop.
import itertools
from pyownet import protocol
p = protocol.proxy('localhost', persistent=False)
freq = 1 << 12
for i in itertools.count():
try:
c = p.dir()
except protocol.Error as exc:
print('Iteration {0} raised exception: {1}'.format(i, exc))
break
None if i % freq else print('Iteration {}'.format(i))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment