change to python3 instead of explicit 3.6

This commit is contained in:
brent s
2018-08-07 10:54:59 -04:00
parent e1cd54a7b2
commit 8c9a3cd14b
21 changed files with 1007 additions and 14 deletions

24
net/bofh_gen.py Executable file
View File

@@ -0,0 +1,24 @@
#!/usr/bin/env python
import telnetlib
import time
counter = 8
def get_excuse():
# http://www.blinkenlights.nl/services.html
# port 23 (default) is Star Wars.
# port 666 is BOfH excuses
with telnetlib.Telnet('towel.blinkenlights.nl', port = 666) as t:
excuse = [x.decode('utf-8').strip() \
for x in t.read_all().split(b'===\r\n')]
return(excuse[2])
def main():
for i in range(counter):
e = get_excuse()
print(e)
time.sleep(1)
if __name__ == '__main__':
main()