Почему модуль клавиатуры не работает в этом l oop? - PullRequest
0 голосов
/ 31 марта 2020

Итак, я пытался запрограммировать атаку грубой силой на Python. Для этого я создал текстовый файл со всеми кнопками, которые я хочу нажать. Вот код:

import keyboard
import time

class liner(object):
    letters = []
    f = open("Letters.txt", "r")
    arrayposition = 0
    def SetValues(self, b):
        letters = []
        f=open("Letters.txt", "r")

        arrayposition=0
        if b==True:
            for line in f:
                line.strip()
                letters.append(line)
        else:
            for line in f:
                letters.append("Null")

l = []
check = 0

for i in range(0, 8):
    l.append(liner())

while True:
    if check<len(l):
        l[check].SetValues(True)

    for c in range(0, len(l)):
        for letter in l[c].letters:
            keyboard.write(str(letter))
            if l[c].arrayposition < len(l[c].letters):
                l[c].arrayposition += 1
            else:
                l[c].arrayposition = 0
                if check <= len(l):
                    check += 1  

Но каждый раз, когда я запускаю его, ничего не происходит. Есть идеи почему?

...