Seite 1 von 1

Hillfe beim lösen von Python Bugs

Verfasst: Freitag 18. Oktober 2019, 18:57
von anonym111
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.

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()
Als Fehlermeldung bekomme ich:

Code: Alles auswählen

 Unused variable 'payload' pylint(unused-variable) [23,5]
                                                             Undefined variable 'response' pylint(undefined-variable) [33,21]

Re: Hillfe beim lösen von Python Bugs

Verfasst: Freitag 18. Oktober 2019, 20:43
von __blackjack__
@anonym111: Was Du falsch machst ist hier nach Hilfe bei einem Skript zu fragen was massenhaft Benutzerkonten bei einem polnischen Webshop anlegen soll. Geht's noch? 😠

Re: Hillfe beim lösen von Python Bugs

Verfasst: Montag 21. Oktober 2019, 15:23
von DeaD_EyE
Mir gehen diese Möchtegernhacker tierisch auf den Sack!
Genau wegen solchen Leuten haben die Serveradmins viel zu tun.