Python Forum
maximum recursion depth exceeded while calling a Python object error in python3
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
maximum recursion depth exceeded while calling a Python object error in python3
#1
Bug 
import time
import random
import string

#Searching vars
tries = 0
found = False

def website():
    print("Website: " + str(res) + "\n")
    print("Q - Exit")
    print("W - Add to favorites")
    print("E - Find another page")
    usr_input = input("> ")
    if usr_input == q:
        exit()
    elif usr_input == w:
        print("Added to favorites\n")
        website()
    elif usr_input == e:
        searching()
    else:
        print("Error, There is no such option.")
        website()

def stats():
    global results
    global tries
    global found
    timer = time.time()
    print("Tries:" + str(tries))
    print("It took:" + str(timer))
    print("\nTo view page press enter.")
    usr_input = input("> ")

def searching():
    global tries

    # Adding and subtracting letters
    tries += 1
    chars = 50
    add_num = False
    while add_num == True:
        chars += 1
        if chars == 50:
            add_num = False
            searching()
        print(chars)
    while chars == False:
        chars -= 1
        if chars == 12:
            add_num = True
            searching()
        print(chars)
    if found == True:
        stats()

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

print("Press enter to find random dark-net website")
usr_input = input("> ")
print("Searching for website...")
time.sleep(10)
searching()
My code suppose to find random dark-net websites by generating random strings with numbers and letters.

error:maximum recursion depth exceeded while calling a Python object

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

Thanks in advance!
Reply


Messages In This Thread
maximum recursion depth exceeded while calling a Python object error in python3 - by Prezess - Aug-01-2020, 08:48 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  python script is hanging while calling a procedure in database prasanthi417 4 522 Jan-17-2024, 02:33 PM
Last Post: deanhystad
  Pyinstaller Maximum recursion bug scales11 8 11,059 Nov-10-2023, 10:26 PM
Last Post: SuzanneKH09
  Need help with 'str' object is not callable error. Fare 4 858 Jul-23-2023, 02:25 PM
Last Post: Fare
  pyscript index error while calling input from html form pyscript_dude 2 991 May-21-2023, 08:17 AM
Last Post: snippsat
  Understanding and debugging memory error crashes with python3.10.10 Arkaik 5 2,108 Apr-18-2023, 03:22 AM
Last Post: Larz60+
  PyRun_SimpleFile calling multiprocessing Python Class cause endless init loop Xeno 2 1,053 Sep-19-2022, 02:32 AM
Last Post: Xeno
  Error in Int object is not subscript-able. kakut 2 1,189 Jul-06-2022, 08:31 AM
Last Post: ibreeden
  python update binary object (override delivered Object properties) pierre38 4 1,773 May-19-2022, 07:52 AM
Last Post: pierre38
  Max recursion depth.... Error MeloB 2 1,903 Feb-16-2022, 05:21 PM
Last Post: MeloB
  Calling python from c++ in visual studio pdk5 0 2,173 May-24-2021, 10:18 AM
Last Post: pdk5

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020