Python PyQt ile Login Penceresi

aytlogo

O Şimdi Asker!
20 Kas 2019
862
1,174
Sanal
Merhaba değerli dostlarım ve hocalarım
Askere gitmeden son bir konu açayım dedim
bu konumda basit bir login paneli yazdım ve sizinle paylaşmak istedim.

ÖZELLİKLERİ
Pek bir özelliği yok sadece tema özelliği ekledim siz istediğiniz gibi geliştirebilirsiniz

SS
pvhir5l.png
ctiulok.png

KOD
Python:
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout, QLabel, QLineEdit, QPushButton, QComboBox, QMessageBox
from PyQt5.QtGui import QFont
from PyQt5.QtCore import Qt

class HackerLoginPanel(QWidget):
    def __init__(self):
        super().__init__()
        self.setWindowTitle("Luxer Giriş Paneli")
        self.setStyleSheet("background-color: black; color: #00ff00; font-family: 'Courier New';")

        self.layout = QVBoxLayout()
        self.setLayout(self.layout)

        ascii_art_label = QLabel()
        ascii_art = """
█████╗ ██╗   ██╗████████╗██╗      ██████╗  ██████╗  ██████╗
██╔══██╗╚██╗ ██╔╝╚══██╔══╝██║     ██╔═══██╗██╔════╝ ██╔═══██╗
███████║ ╚████╔╝    ██║   ██║     ██║   ██║██║  ███╗██║   ██║
██╔══██║  ╚██╔╝     ██║   ██║     ██║   ██║██║   ██║██║   ██║
██║  ██║   ██║      ██║   ███████╗╚██████╔╝╚██████╔╝╚██████╔╝
╚═╝  ╚═╝   ╚═╝      ╚═╝   ╚══════╝ ╚═════╝  ╚═════╝  ╚═════╝
                                                                    
   ██╗     ██╗   ██╗██╗  ██╗███████╗██████╗             
    ██║     ██║   ██║╚██╗██╔╝██╔════╝██╔══██╗           
    ██║     ██║   ██║ ╚███╔╝ █████╗  ██████╔╝           
    ██║     ██║   ██║ ██╔██╗ ██╔══╝  ██╔══██╗           
    ███████╗╚██████╔╝██╔╝ ██╗███████╗██║  ██║           
    ╚══════╝ ╚═════╝ ╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝           
                                                                    
                """
        ascii_art_label.setText(ascii_art)
        ascii_art_label.setFont(QFont('Courier New', 12))
        ascii_art_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
        self.layout.addWidget(ascii_art_label)

        input_layout = QVBoxLayout()
        self.layout.addLayout(input_layout)

        self.username_label = QLabel("Kullanıcı Adı")
        self.username_label.setFont(QFont('Monospace', 12))
        input_layout.addWidget(self.username_label, alignment=Qt.AlignmentFlag.AlignCenter)

        self.username_input = QLineEdit()
        input_layout.addWidget(self.username_input)

        self.password_label = QLabel("Şifre")
        self.password_label.setFont(QFont('Monospace', 12))
        input_layout.addWidget(self.password_label, alignment=Qt.AlignmentFlag.AlignCenter)

        self.password_input = QLineEdit()
        self.password_input.setEchoMode(QLineEdit.EchoMode.Password)
        input_layout.addWidget(self.password_input)

        self.theme_combobox = QComboBox()
        self.theme_combobox.addItems(["Yeşil", "Kırmızı", "Mavi", "Mor", "Turkuaz"])
        self.theme_combobox.currentIndexChanged.connect(self.change_theme)
        self.layout.addWidget(self.theme_combobox, alignment=Qt.AlignmentFlag.AlignCenter)

        self.login_button = QPushButton("Giriş Yap")
        self.login_button.setStyleSheet("""
            QPushButton {
                background-color: #008000; /* Yeşil */
                border: 2px solid #00ff00;
                border-radius: 5px;
                color: white;
                font-weight: bold;
            }
            QPushButton:hover {
                background-color: #00a000; /* Daha koyu yeşil */
            }
        """)
        self.login_button.clicked.connect(self.check_credentials)
        self.layout.addWidget(self.login_button, alignment=Qt.AlignmentFlag.AlignCenter)

    def change_theme(self, index):
        if index == 0:
            self.setStyleSheet("background-color: black; color: #00ff00; font-family: 'Courier New';")
            self.login_button.setStyleSheet("""
                QPushButton {
                    background-color: #008000; /* Yeşil */
                    border: 2px solid #00ff00;
                    border-radius: 5px;
                    color: white;
                    font-weight: bold;
                }
                QPushButton:hover {
                    background-color: #00a000; /* Daha koyu yeşil */
                }
            """)
        elif index == 1:
            self.setStyleSheet("background-color: black; color: red; font-family: 'Courier New';")
            self.login_button.setStyleSheet("""
                QPushButton {
                    background-color: #800000; /* Kırmızı */
                    border: 2px solid #ff0000;
                    border-radius: 5px;
                    color: white;
                    font-weight: bold;
                }
                QPushButton:hover {
                    background-color: #a00000; /* Daha koyu kırmızı */
                }
            """)
        elif index == 2:
            self.setStyleSheet("background-color: black; color: blue; font-family: 'Courier New';")
            self.login_button.setStyleSheet("""
                QPushButton {
                    background-color: #000080; /* Mavi */
                    border: 2px solid #0000ff;
                    border-radius: 5px;
                    color: white;
                    font-weight: bold;
                }
                QPushButton:hover {
                    background-color: #0000a0; /* Daha koyu mavi */
                }
            """)
        elif index == 3:
            self.setStyleSheet("background-color: black; color: purple; font-family: 'Courier New';")
            self.login_button.setStyleSheet("""
                QPushButton {
                    background-color: #800080; /* Mor */
                    border: 2px solid #ff00ff;
                    border-radius: 5px;
                    color: white;
                    font-weight: bold;
                }
                QPushButton:hover {
                    background-color: #9400d3; /* Daha koyu mor */
                }
            """)
        elif index == 4:
            self.setStyleSheet("background-color: black; color: #008b8b; font-family: 'Courier New';")
            self.login_button.setStyleSheet("""
                QPushButton {
                    background-color: #008b8b; /* Turkuaz */
                    border: 2px solid #00ced1;
                    border-radius: 5px;
                    color: white;
                    font-weight: bold;
                }
                QPushButton:hover {
                    background-color: #00bfbf; /* Daha koyu turkuaz */
                }
            """)

    def check_credentials(self):
        username = self.username_input.text()
        password = self.password_input.text()

        if username == "admin" and password == "admin123":
            QMessageBox.information(self, "Başarılı", "Giriş başarılı!")
        else:
            QMessageBox.critical(self, "Hata", "Kullanıcı adı veya şifre hatalı!")

if __name__ == "__main__":
    app = QApplication(sys.argv)
    window = HackerLoginPanel()
    window.show()
    sys.exit(app.exec_())
 
Moderatör tarafında düzenlendi:

Privarp

Anka Team Junior
8 Nis 2022
128
41
Merhaba değerli dostlarım ve hocalarım
Askere gitmeden son bir konu açayım dedim
bu konumda basit bir login paneli yazdım ve sizinle paylaşmak istedim.

ÖZELLİKLERİ
Pek bir özelliği yok sadece tema özelliği ekledim siz istediğiniz gibi geliştirebilirsiniz

SS
pvhir5l.png
ctiulok.png

KOD
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout, QLabel, QLineEdit, QPushButton, QComboBox, QMessageBox
from PyQt5.QtGui import QFont
from PyQt5.QtCore import Qt

class HackerLoginPanel(QWidget):
def __init__(self):
super().__init__()
self.setWindowTitle("Luxer Giriş Paneli")
self.setStyleSheet("background-color: black; color: #00ff00; font-family: 'Courier New';")

self.layout = QVBoxLayout()
self.setLayout(self.layout)

ascii_art_label = QLabel()
ascii_art = """
█████╗ ██╗ ██╗████████╗██╗ ██████╗ ██████╗ ██████╗
██╔══██╗╚██╗ ██╔╝╚══██╔══╝██║ ██╔═══██╗██╔════╝ ██╔═══██╗
███████║ ╚████╔╝ ██║ ██║ ██║ ██║██║ ███╗██║ ██║
██╔══██║ ╚██╔╝ ██║ ██║ ██║ ██║██║ ██║██║ ██║
██║ ██║ ██║ ██║ ███████╗╚██████╔╝╚██████╔╝╚██████╔╝
╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝ ╚═════╝ ╚═════╝ ╚═════╝

██╗ ██╗ ██╗██╗ ██╗███████╗██████╗
██║ ██║ ██║╚██╗██╔╝██╔════╝██╔══██╗
██║ ██║ ██║ ╚███╔╝ █████╗ ██████╔╝
██║ ██║ ██║ ██╔██╗ ██╔══╝ ██╔══██╗
███████╗╚██████╔╝██╔╝ ██╗███████╗██║ ██║
╚══════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝

"""
ascii_art_label.setText(ascii_art)
ascii_art_label.setFont(QFont('Courier New', 12))
ascii_art_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
self.layout.addWidget(ascii_art_label)

input_layout = QVBoxLayout()
self.layout.addLayout(input_layout)

self.username_label = QLabel("Kullanıcı Adı")
self.username_label.setFont(QFont('Monospace', 12))
input_layout.addWidget(self.username_label, alignment=Qt.AlignmentFlag.AlignCenter)

self.username_input = QLineEdit()
input_layout.addWidget(self.username_input)

self.password_label = QLabel("Şifre")
self.password_label.setFont(QFont('Monospace', 12))
input_layout.addWidget(self.password_label, alignment=Qt.AlignmentFlag.AlignCenter)

self.password_input = QLineEdit()
self.password_input.setEchoMode(QLineEdit.EchoMode.Password)
input_layout.addWidget(self.password_input)

self.theme_combobox = QComboBox()
self.theme_combobox.addItems(["Yeşil", "Kırmızı", "Mavi", "Mor", "Turkuaz"])
self.theme_combobox.currentIndexChanged.connect(self.change_theme)
self.layout.addWidget(self.theme_combobox, alignment=Qt.AlignmentFlag.AlignCenter)

self.login_button = QPushButton("Giriş Yap")
self.login_button.setStyleSheet("""
QPushButton {
background-color: #008000; /* Yeşil */
border: 2px solid #00ff00;
border-radius: 5px;
color: white;
font-weight: bold;
}
QPushButton:hover {
background-color: #00a000; /* Daha koyu yeşil */
}
""")
self.login_button.clicked.connect(self.check_credentials)
self.layout.addWidget(self.login_button, alignment=Qt.AlignmentFlag.AlignCenter)

def change_theme(self, index):
if index == 0:
self.setStyleSheet("background-color: black; color: #00ff00; font-family: 'Courier New';")
self.login_button.setStyleSheet("""
QPushButton {
background-color: #008000; /* Yeşil */
border: 2px solid #00ff00;
border-radius: 5px;
color: white;
font-weight: bold;
}
QPushButton:hover {
background-color: #00a000; /* Daha koyu yeşil */
}
""")
elif index == 1:
self.setStyleSheet("background-color: black; color: red; font-family: 'Courier New';")
self.login_button.setStyleSheet("""
QPushButton {
background-color: #800000; /* Kırmızı */
border: 2px solid #ff0000;
border-radius: 5px;
color: white;
font-weight: bold;
}
QPushButton:hover {
background-color: #a00000; /* Daha koyu kırmızı */
}
""")
elif index == 2:
self.setStyleSheet("background-color: black; color: blue; font-family: 'Courier New';")
self.login_button.setStyleSheet("""
QPushButton {
background-color: #000080; /* Mavi */
border: 2px solid #0000ff;
border-radius: 5px;
color: white;
font-weight: bold;
}
QPushButton:hover {
background-color: #0000a0; /* Daha koyu mavi */
}
""")
elif index == 3:
self.setStyleSheet("background-color: black; color: purple; font-family: 'Courier New';")
self.login_button.setStyleSheet("""
QPushButton {
background-color: #800080; /* Mor */
border: 2px solid #ff00ff;
border-radius: 5px;
color: white;
font-weight: bold;
}
QPushButton:hover {
background-color: #9400d3; /* Daha koyu mor */
}
""")
elif index == 4:
self.setStyleSheet("background-color: black; color: #008b8b; font-family: 'Courier New';")
self.login_button.setStyleSheet("""
QPushButton {
background-color: #008b8b; /* Turkuaz */
border: 2px solid #00ced1;
border-radius: 5px;
color: white;
font-weight: bold;
}
QPushButton:hover {
background-color: #00bfbf; /* Daha koyu turkuaz */
}
""")

def check_credentials(self):
username = self.username_input.text()
password = self.password_input.text()

if username == "admin" and password == "admin123":
QMessageBox.information(self, "Başarılı", "Giriş başarılı!")
else:
QMessageBox.critical(self, "Hata", "Kullanıcı adı veya şifre hatalı!")

if __name__ == "__main__":
app = QApplication(sys.argv)
window = HackerLoginPanel()
window.show()
sys.exit(app.exec_())
Eline sağlık.
 

aytlogo

O Şimdi Asker!
20 Kas 2019
862
1,174
Sanal
Eline sağlık hocam hayırlı teskereler.
Hayırlı teskereler olur umarım, eline sağlık.
Elinize sağlık hocam hayırlı teskereler olsun.
Ellerine sağlık hayırlısı ile git hayırlısı ile gel dostum bekliyoruz :)
Emeğine sağlık.
emeğine sağlık.
Eline sağlık, sağlıklı gidip gelmen dileğiyle. Hayırlı tezkereler.
Herkese teşekkür ederim dostlarım
 
Üst

Turkhackteam.org internet sitesi 5651 sayılı kanun’un 2. maddesinin 1. fıkrasının m) bendi ile aynı kanunun 5. maddesi kapsamında "Yer Sağlayıcı" konumundadır. İçerikler ön onay olmaksızın tamamen kullanıcılar tarafından oluşturulmaktadır. Turkhackteam.org; Yer sağlayıcı olarak, kullanıcılar tarafından oluşturulan içeriği ya da hukuka aykırı paylaşımı kontrol etmekle ya da araştırmakla yükümlü değildir. Türkhackteam saldırı timleri Türk sitelerine hiçbir zararlı faaliyette bulunmaz. Türkhackteam üyelerinin yaptığı bireysel hack faaliyetlerinden Türkhackteam sorumlu değildir. Sitelerinize Türkhackteam ismi kullanılarak hack faaliyetinde bulunulursa, site-sunucu erişim loglarından bu faaliyeti gerçekleştiren ip adresini tespit edip diğer kanıtlarla birlikte savcılığa suç duyurusunda bulununuz.