What I am trying to accomplish is to read file A then run it through a filter process to then write file B with the filtered words. I have other systems in place to have this called when I require it, however, I need to make this an executable file from my guess.
I went ahead and am currently running Python 3.7.9 with pip 20.2.2
I installed pyinstaller
to create the executable file. During packing though, it reaches the 1k recursion threshold.
From my knowledge of looking, this means that it is calling on itself in a loop, am I incorrect? I re-wrote it simply and when I run the script it does exactly what I need it to. However, it still comes off as a loop. I may just be missing something simple so thank you to anyone who assists.
Also, because I am newer to this stuff, please keep the terminology to a beginner level if you can. However, if not, I'll be using my best friend google haha.
Thank you guys, here is the code I am working with:
from profanity_filter import ProfanityFilter
pf = ProfanityFilter()
contents = ''
checks = False
def filtering():
global contents
myfile = open("D:\\Pictures\\test_project\\Story_Time\\StoryTimeV1.txt")
contents = pf.censor(myfile.read())
myfile.close()
def filtering2():
global contents
global checks
myfile2 = open("D:\\Pictures\\test_project\\Story_Time\\StoryTimeV2.txt", "w")
myfile2.write(contents)
myfile2.close()
checks = True
while checks == False:
filtering()
filtering2()
The error code is given:
RecursionError: maximum recursion depth exceeded while calling a Python object
I also am in the correct directory etc. I am sure one of you will be able to pick up on what I may be screwing up haha. Thank you, everyone!