Generation

generate functionTue, 11 Jul 2023

saved passwords finder for python also add functions of python save as txt file

passwords = open("passwords.txt", "a") #open the file passwords.write("saved passwords\n") #write this text to the file passwords.write("passwords\n") #write this text to the file passwords.close() #close the file #! python3 # find passwords in python files import os, re # find passwords passwordRegex = re.compile(r"password: (\d\d\d\d\d\d)") # loop over all the files in current working directory for filename in os.listdir("."): if filename.endswith(".txt"): textFile = open(filename) content = textFile.read() textFile.close() # find all matches of password regex mo = passwordRegex.findall(content) if len(mo) > 0: print("found passwords in: " + filename) print("passwords: " + mo[0])

Questions about programming?Chat with your personal AI assistant