-5

I'm trying to Open a file as text, choosing the file via str(raw_input, but it doesn't work with def main():.

My second script, with normal (No threading), is using try:. The threading one not opening the email.
Here is a link to the scripts in ghostbin:

Normal Script Without Threading and Multithread Script ,

The Normal Script Without Threading

try:
    filelist = str(raw_input("[+] Enter Mailist File: "))
    loglive = open('live.txt','a')
    logdie = open('die.txt','a')
    logun = open('uncheck.txt','a')
except Exception as Err:
    print("ERROR : File List Not Found!")
    sys.exit()
list = open(filelist, "r")
while True:
    email = list.readline().replace("\n","")
    if not email:
        break

Multithread Script

def main():
    start_time = time.time()
    tanya = str(raw_input("[+] Enter Mailist File: "))
    mailist = open(tanya, 'r')
    while True:
        email = mailist.readline().replace("\n","")
        if not email:
            break
    s = requests.session()
SherylHohman
  • 16,580
  • 17
  • 88
  • 94
  • 1
    What do you mean with "StackOverflow really don't nice with python"? I edited your question by putting the code snippet. – YusufUMS Mar 11 '19 at 13:37

1 Answers1

0

You need to call the main function for it to be executed. At the end of your file, add:

if __name__ == '__main__':
    main()

The reason for this can be found here: What does if __name__ == "__main__": do?

devnull
  • 443
  • 6
  • 13