comparison py/lcd.py @ 154:542efb356e46

back to random words on the lcd
author Matt Johnston <matt@ucc.asn.au>
date Thu, 20 Dec 2012 22:26:33 +0800
parents 171cdf716473
children
comparison
equal deleted inserted replaced
153:0529f3527626 154:542efb356e46
58 l.setup() 58 l.setup()
59 l.put(0, 'a') 59 l.put(0, 'a')
60 l.put(1, 'b') 60 l.put(1, 'b')
61 l.put(4, 'b') 61 l.put(4, 'b')
62 62
63 #words = [word.strip() for word in file('/usr/share/dict/words', 'r')] 63 words = [word.strip() for word in file('/usr/share/dict/words', 'r')]
64 #random.shuffle(words) 64 random.shuffle(words)
65 words = file(sys.argv[1], 'r').read().split() 65 #words = file(sys.argv[1], 'r').read().split()
66 66
67 pos = 0 67 pos = 0
68 last = '' 68 last = ''
69 for word in words: 69 for word in words:
70 word = (word + ' '*16)[:16] 70 word = (word + ' '*16)[:16]
72 #word = random.sample(words, 1)[0][:16] + ' '*16 72 #word = random.sample(words, 1)[0][:16] + ' '*16
73 #char = chr(int(random.random() * 26) + ord('a')) 73 #char = chr(int(random.random() * 26) + ord('a'))
74 l.put(0, last) 74 l.put(0, last)
75 l.put(16, word) 75 l.put(16, word)
76 last = word 76 last = word
77 time.sleep(0.1) 77 time.sleep(0.3)