异步此功能

时间:2019-06-27 13:10:28

标签: asynchronous python-3.6

我希望此函数在程序中异步运行,问题是我什至不知道我到处都搜索过(我对此很陌生)

url = urlInputMenu.get()
textMenu.insert("end-1c","\n")
for anyreg in choices:
    try: 
        res = dns.resolver.query(url,anyreg)
        textMenu.insert("end-1c","\n")
        textMenu.insert("end-1c",res.response.answer,"correct")
        a = res.response.answer
        stringtoFile.append(a)


    except:
        textMenu.insert("end-1c","\n")
        textMenu.insert("end-1c","error geting the {} record ".format(anyreg),"Alert")

        continue

0 个答案:

没有答案