Created
December 12, 2010 05:08
-
-
Save liuliu/737871 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random; | |
def alphabet_range(start_with, limit): | |
alphabet = '$abcdefghijklmnopqrstuvwxyz' # alphabet set, don't modify it | |
i = 0 | |
n = 0 | |
while n < limit: # from 1 to some number | |
w = [] | |
k = i | |
while k > 0: | |
w.append(alphabet[k % 27]) # shortcut for enumeration, covert to 27-ary number | |
k = k / 27 | |
i += 1 | |
if w.count('$') > 0: | |
continue | |
w.reverse() # reverse the list (otherwise will be aa, ba, ca, da, strange) | |
word = ''.join(w) # generate string | |
if start_with is not None and word != start_with: #check if it is start string, if not, continue | |
continue | |
start_with = None # if it is, start from here, output every string | |
n += 1 | |
yield word # output generated string | |
pics=[ , , , , , , , , , , , , , , , , , , , , , , , , , , , ] | |
for word in alphabet_range('abc', 5000): | |
switchApp("firefox.app") | |
if exists( ): | |
click( ) | |
wait(8) | |
click( ) | |
wait(8) | |
else: | |
wait(0) | |
switchApp("firefox.app") | |
while not exists ( ): | |
sleep(0.01) | |
click( ) | |
while not exists( ): | |
sleep(0.01) | |
keyDown(Key.PAGE_DOWN) | |
keyUp() | |
click( ) | |
keyDown(Key.BACKSPACE) | |
keyUp() | |
wait(2) | |
keyDown(Key.BACKSPACE) | |
keyUp() | |
wait(2) | |
type(word) | |
wait(2) | |
keyDown(Key.ENTER) | |
keyUp() | |
click( ) | |
wait(2) | |
while not exists( ): | |
sleep(0.01) | |
keyDown(Key.END) | |
keyUp() | |
click( ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment