samedi 1 août 2020

"maximum recursion depth exceeded while calling a Python object" error in python3 [closed]

import time
import random
import string

#Searching vars
tries = 0
found = False
add_nums = False

def website():
    print("Website: " + str(res))

def stats():
    global results
    global tries
    global found
    print("Ammount of tries:" + str(tries))
    print("It took:" + str(timer))
    print("\nTo view the page click enter.")
    usr_input = input("> ")

def searching():
    global tries
    global add_nums

# Adding and subtracting letters
tries += 1
chars = 50
if add_nums == True:
    chars += 1
elif add_nums == False:
    chars -= 1
elif chars == 12:
    add_nums = True
elif chars == 50:
    add_nums = False

#start
res = ''.join(random.choices(string.ascii_lowercase + string.ascii_uppercase + string.digits, k =     chars))
res += ".onion"
######
searching()

print("Press enter to find random website in dark-net.")
usr_input = input("> ")
print("Search will start in 10 seconds...")
time.sleep(10)

#Starting timer
timer = time.time()
searching()

error: maximum recursion depth exceeded while calling a Python object

I know what this error means but I don't know how to solve it.

I think the error is related to lines with if elif chars -= 1, etc.

Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire