Python停止在Windows和控制台冻结上工作

时间:2018-05-17 04:26:17

标签: python windows windows-console

首先,我是一名笔测试员,所以我使用Python& Perl一直都是。我编写了一个Python脚本,用于利用Wordpress进行大规模测试来测试服务器上的所有网站。该脚本在Linux(Kali Linux& Ubuntu)上完美运行,但是当我在Windows上使用它时,它只能工作5或10分钟,然后控制台完全停止工作。我无法正常退出脚本。如果我关闭控制台窗口,我只能退出Python。我不认为问题出在脚本中,因为其他脚本显示同样的问题。如果我改变窗户,它仍然是同样的问题。

以下是我的Python脚本的一些行:

#!/usr/bin/python

import requests, re, urllib2, os, sys, codecs                   
from multiprocessing.dummy import Pool                          
from time import time as timer  
import time 
from random import sample as rand                       
from platform import system 
from colorama import Fore                               
from colorama import Style                              
from pprint import pprint                               
from colorama import init                                               
init(autoreset=True)
try:
    with codecs.open(sys.argv[1], mode='r', encoding='ascii', errors='ignore') as f:
        ooo = f.read().splitlines()
except IOError:
    pass
ooo = list((ooo))



def banners():


    if system() == 'Linux':
        os.system('clear')
    if system() == 'Windows':
        os.system('cls')

        banner = """{}{} \n \n

    Coded to w

        \n""".format(fc, sb)
print banner
Agent = {'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:28.0) Gecko/20100101 Firefox/28.0'}
user_agent = "Mozilla/5.0 (iPhone; CPU iPhone OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3"
baaReflexlibr = requests.get(url)

        if "/wp-content/" in baaReflexlibr.text:
            print ''.format(fg, fg, url, fc,fc, sb,fr)
            wpsbot(url)         
        else:
            print ''.format(sb, sd, url, fc,fc, sb,fr)
except:
        pass
def wpsbot(url):



    try:
        some exploits and 0days
  except:
        pass




banners()


def Main():
    try:

        start = timer()
        ThreadPool = Pool(30)
        Threads = ThreadPool.map(sitebul, ooo)
        print('Time: ' + str(timer() - start) + ' seconds')
    except:
        pass


if __name__ == '__main__':
    Main()

0 个答案:

没有答案