Hillfe beim lösen von Python Bugs
Verfasst: Freitag 18. Oktober 2019, 18:57
Hey,
Ich bin was Python angeht, noch ein Beginner und weiß ich nicht was ich falsch gemacht habe. Wäre cool, wenn jmd. mal rübergucken würde.
Als Fehlermeldung bekomme ich:
Ich bin was Python angeht, noch ein Beginner und weiß ich nicht was ich falsch gemacht habe. Wäre cool, wenn jmd. mal rübergucken würde.
Code: Alles auswählen
import requests
import random
from random import getrandbits
import time
session = requests.session()
url = 'https://chmielna20.pl/en/register'
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36'}
name = 'John' #Beliebiger Name
surname = 'Doe' #Beliebiger Nachname
email = 'test+{}@gmail.com'.format(getrandbits(40)) #random gmail, catchall is möglich
password = 'Testing1234' #Random Password
times = int(input("[" + (time.strftime("%H:%M:%S") + "]" + " - Enter the number of account(s) you would like to create: ")))
text_file = open("chmielna accounts.txt", "w")
def create_account():
print("[" + (time.strftime("%H:%M:%S")) + "]" + " - SUBMITTING INFO.....")
global session
global email
payload = {
"Name": name,
"surname": surname,
"email": email,
"password": password,
"zapoznalem": "on"
}
def write():
text_file.write(email + ":" + password + "\n")
if "Success" in response.text:
print("[" + (time.strftime("%H:%M:%S")) + "]" +" - SUCCESSFULLY CREATED ACCOUNT "+email+":"+password)
write()
Code: Alles auswählen
Unused variable 'payload' pylint(unused-variable) [23,5]
Undefined variable 'response' pylint(undefined-variable) [33,21]