简体   繁体   English

Python 脚本帐户生成器

[英]Python script account generator

Hi everyone I'm having a problem with my script.大家好,我的脚本有问题。 Basically it creates no account and doesn't write them in my.txt file(when I open it,it's empty) but it prints emails and password.基本上它不会创建帐户,也不会将它们写入 my.txt 文件(当我打开它时,它是空的),但它会打印电子邮件和密码。 Could you please help me?请你帮助我好吗? I expect to have some working accounts and read them in my.txt file Hope you can help me,thanks in advance PS: data_gen is a dict that contains the infos for the post request (registration)我希望有一些工作帐户并在 my.txt 文件中阅读它们希望您能帮助我,在此先感谢 PS:data_gen 是一个包含发布请求(注册)信息的字典

times = int(input("[" + (time.strftime("%H:%M:%S") + "]" + " - How many accounts?: ")))

Nome_completo = "testname"
Nome = Nome_completo.split()[0]
email = "test+{}@gmail.com".format(getrandbits(8))
Giorno_compleanno = random.randint(10, 27)
Mese_compleanno = random.randint(0, 12)
Anno = random.randint(1982, 2003)
Data_completa = str(str(Giorno_compleanno) + "/" + str(Mese_compleanno) + "/" + str(Anno))
password_1 = "test_1234"

s = requests.session()
r_1 = s.get(awlab_url,headers=headers)
r = s.get(url, headers=headers)

text_file = open("awlabaccounts", "r+")
def create():
    global email
    global password_1
    if str(200) in str(r.status_code):
        text_file.write(email + ":" + password_1 + "\n")
        print("Accounts successfully created!")

    else:
        print("ERROR!")
reg = s.post(url_post, data=data_gen, headers=headers)

for i in range(times):
    create()

You need to close the text file at the end of the code.您需要在代码末尾关闭文本文件。

for i in range(times):
    create()
text_file.close()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM