from PyQt6.QtWidgets import QApplication, QWidget, QLineEdit
from PyQt6.QtGui import QIcon, QFont
import sys
class Window(QWidget):
def __init__(self):
super().__init__()
self.setGeometry(200, 200, 700, 400)
self.setWindowTitle("password")
self.setWindowIcon(QIcon('images/python.png'))
line_edit = QLineEdit(self)
line_edit.setFont(QFont("Sanserif", 15))
line_edit.setEchoMode(QLineEdit.EchoMode.Password)
line_edit.textChanged.connect(self.on_text_changed)
def on_text_changed(self, text):
print(f"Текущий текст в поле: {text}")
app = QApplication(sys.argv)
window = Window()
window.show()
sys.exit(app.exec())