なぜ動かないんでしょうか
また、間違っているところがあると思うので教えて頂けるとうれしいです
python
1# -*- coding: utf-8 -*- 2 3import random 4import urllib.request 5from string import ascii_lowercase, digits 6 7 8Strings = lambda : ascii_lowercase + digits + '_' 9 10def Id_cnt(num): 11 return len(Strings()) ** num 12 13def random_str(loop): 14 box = [] 15 while 1: 16 if len(box) == Id_cnt(loop): return box 17 id_gen = ''.join([random.choice(Strings()) for i in range(loop)]) 18 if box.count(id_gen) == 1: 19 sorted(set(box.append(id_gen))) 20 21def twitter_acc(url): 22 try: 23 t_url = urllib.request.urlopen(url) 24 print("{0} {1}".format(url, "is found !")) 25 t_url.close() 26 except Exception as e: 27 print("{0} {1}".format(url, "is not found")) 28 29def end(loop_2): 30 liv = random_str(loop_2) 31 for p in range(len(liv)): 32 inp_url = "http://twitter.com/{}".format(liv[p]) 33 print(twitter_acc(inp_url))
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2015/07/18 12:23
2015/07/18 12:42 編集
2015/07/18 13:19