首页 > 其他分享 >pyqt6 登录窗口

pyqt6 登录窗口

时间:2023-12-10 17:46:19浏览次数:33  
标签:窗口 登录 self pyqt6 QtWidgets window input login button

pyqt_login-master/main.py

import sys

from PyQt6 import QtGui, QtWidgets
from PyQt6.QtWidgets import QMainWindow, QMessageBox

from Windows import login

user_icon = "assets/favicon.ico"

users = {"user": "admin123"}


class Login(QMainWindow, login.MainWindow):
    """Handles the login window events"""

    def __init__(self, *args, **kwargs):
        QMainWindow.__init__(self, *args, **kwargs)
        self.set_ui(self)
        self.login_button.clicked.connect(self.check)  # Connects the button to an action
        self.save_button.clicked.connect(self.check_save)

    def check(self):
        """Checks if the given credentials are inside the database, in this case, a dictionary"""
        if self.user_input.text() in users and self.password_input.text() == users[self.user_input.text()]:
            msg = QMessageBox()
            msg.setWindowIcon(QtGui.QIcon(user_icon))
            msg.setText("Successfull!")
            msg.setInformativeText("The credentials are correct.")
            msg.setWindowTitle("login")
            msg.exec()
        else:
            msg = QMessageBox()
            msg.setWindowIcon(QtGui.QIcon(user_icon))
            msg.setText("Error!")
            msg.setInformativeText("The credentials are incorrect.")
            msg.setWindowTitle("login")
            msg.exec()

    def check_save(self):
        msg = QMessageBox()
        msg.setWindowIcon(QtGui.QIcon(user_icon))
        msg.setText("密码已更新")
        msg.setInformativeText("!!!密码加密保存成功!!!")
        msg.setWindowTitle("密码更新")
        msg.exec()

    def check_scorll_area(self):
        print("")


if __name__ == "__main__":
    app = QtWidgets.QApplication(sys.argv)
    MainWindow = QtWidgets.QMainWindow()
    app.setStyleSheet(open("assets/style.css", encoding="utf-8").read())
    login_gui = Login()
    login_gui.show()
    sys.exit(app.exec())

pyqt_login-master/Windows/login.py.o1.txt

from PyQt6 import QtCore, QtGui, QtWidgets

user_icon = "assets/favicon.ico"


class MainWindow(object):

    """Login window definition"""

    def set_ui(self, login_window):
        """_summary_

        Args:
            login_window (_type_): _description_
        """
        login_window.setObjectName("login_window")
        login_window.resize(291, 160)
        login_window.setTabShape(QtWidgets.QTabWidget.TabShape.Rounded)
        login_window.setWindowIcon(QtGui.QIcon(user_icon))

        self.centralwidget = QtWidgets.QWidget(login_window)
        self.centralwidget.setObjectName("centralwidget")

        self.login_button = QtWidgets.QPushButton(self.centralwidget)
        self.login_button.setGeometry(QtCore.QRect(10, 10, 271, 31))
        font = QtGui.QFont()
        font.setFamily("Nunito Sans")
        self.login_button.setFont(font)
        self.login_button.setObjectName("login_button")

        self.save_button = QtWidgets.QPushButton(self.centralwidget)
        self.save_button.setGeometry(QtCore.QRect(10, 110, 271, 31))
        self.save_button.setObjectName("save_button")

        self.user_input = QtWidgets.QLineEdit(self.centralwidget)
        self.user_input.setGeometry(QtCore.QRect(10, 50, 271, 25))
        font = QtGui.QFont()
        font.setFamily("Nunito Sans")
        self.user_input.setFont(font)
        self.user_input.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
        self.user_input.setObjectName("user_input")

        self.password_input = QtWidgets.QLineEdit(self.centralwidget)
        self.password_input.setGeometry(QtCore.QRect(10, 80, 271, 25))
        font = QtGui.QFont()
        font.setFamily("Nunito Sans")
        self.password_input.setFont(font)
        self.password_input.setEchoMode(QtWidgets.QLineEdit.EchoMode.Password)
        self.password_input.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
        self.password_input.setObjectName("password_input")
        login_window.setCentralWidget(self.centralwidget)

        self.retranslate_ui(login_window)
        QtCore.QMetaObject.connectSlotsByName(login_window)

    def retranslate_ui(self, login_window):
        translate = QtCore.QCoreApplication.translate
        login_window.setWindowTitle(translate("login_window", "AGV"))
        self.login_button.setText(translate("login_window", "登录AGV"))
        self.save_button.setText(translate("login_window", "保存密码"))
        self.user_input.setPlaceholderText(translate("login_window", "请输入账号"))
        self.password_input.setPlaceholderText(translate("login_window", "请输入密码"))

pyqt_login-master/Windows/__init__.py



pyqt_login-master/Windows/login.py.05.txt

from PyQt6 import QtCore, QtGui, QtWidgets

user_icon = "assets/favicon.ico"


class MainWindow(object):
    """Login window definition"""

    def set_ui(self, login_window):
        """_summary_

        Args:
            login_window (_type_): _description_
        """
        login_window.setObjectName("login_window")
        login_window.resize(300, 500)
        login_window.setTabShape(QtWidgets.QTabWidget.TabShape.Rounded)
        login_window.setWindowIcon(QtGui.QIcon(user_icon))

        self.centralwidget = QtWidgets.QWidget(login_window)
        self.centralwidget.setObjectName("centralwidget")

        grid_layout = QtWidgets.QGridLayout(self.centralwidget)

        self.user_input = QtWidgets.QLineEdit()
        font = QtGui.QFont()
        self.user_input.setFont(font)
        self.user_input.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
        self.user_input.setObjectName("user_input")
        grid_layout.addWidget(self.user_input, 0, 0, 1, 1)

        self.password_input = QtWidgets.QLineEdit()
        font = QtGui.QFont()
        self.password_input.setFont(font)
        self.password_input.setEchoMode(QtWidgets.QLineEdit.EchoMode.Password)
        self.password_input.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
        self.password_input.setObjectName("password_input")
        self.password_input.setGeometry(QtCore.QRect(10, 10, 271, 31))
        grid_layout.addWidget(self.password_input, 0, 1, 1, 1)

        self.save_button = QtWidgets.QPushButton()
        self.save_button.setObjectName("save_button")
        grid_layout.addWidget(self.save_button, 0, 2, 1, 1)

        self.login_button = QtWidgets.QPushButton()
        font = QtGui.QFont()
        self.login_button.setFont(font)
        self.login_button.setObjectName("login_button")
        # def addLayout(self, a0: QLayout, row: int, column: int, rowSpan: int, columnSpan: int, alignment: QtCore.Qt.AlignmentFlag = ...) -> None: ...
        grid_layout.addWidget(self.login_button, 1, 0, 1, 3)
        login_window.setCentralWidget(self.centralwidget)

        self.retranslate_ui(login_window)
        QtCore.QMetaObject.connectSlotsByName(login_window)

    def retranslate_ui(self, login_window):
        translate = QtCore.QCoreApplication.translate
        login_window.setWindowTitle(translate("login_window", "AGV"))
        self.login_button.setText(translate("login_window", "登录AGV"))
        self.save_button.setText(translate("login_window", "保存密码"))
        self.user_input.setPlaceholderText(translate("login_window", "请输入账号"))
        self.password_input.setPlaceholderText(translate("login_window", "请输入密码"))

pyqt_login-master/Windows/login.py

from PyQt6 import QtCore, QtGui, QtWidgets

user_icon = "assets/favicon.ico"


class MainWindow(object):
    """Login window definition"""

    def set_ui(self, login_window):
        """_summary_

        Args:
            login_window (_type_): _description_
        """
        login_window.setObjectName("login_window")
        login_window.resize(500, 500)
        login_window.setTabShape(QtWidgets.QTabWidget.TabShape.Rounded)
        login_window.setWindowIcon(QtGui.QIcon(user_icon))
        login_window.setWindowTitle("一键登录")

        self.centralwidget = QtWidgets.QWidget(login_window)
        self.centralwidget.setObjectName("centralwidget")

        grid_layout = QtWidgets.QGridLayout(self.centralwidget)

        self.user_input = QtWidgets.QLineEdit()
        font = QtGui.QFont()
        self.user_input.setFont(font)
        self.user_input.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
        self.user_input.setObjectName("user_input")
        self.user_input.setPlaceholderText("请输入账号")
        grid_layout.addWidget(self.user_input, 0, 0, 1, 1)

        self.password_input = QtWidgets.QLineEdit()
        font = QtGui.QFont()
        self.password_input.setFont(font)
        self.password_input.setEchoMode(QtWidgets.QLineEdit.EchoMode.Password)
        self.password_input.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
        self.password_input.setObjectName("password_input")
        self.password_input.setPlaceholderText("请输入密码")
        grid_layout.addWidget(self.password_input, 0, 1, 1, 1)

        self.save_button = QtWidgets.QPushButton()
        self.save_button.setObjectName("save_button")
        self.save_button.setText("保存密码")

        grid_layout.addWidget(self.save_button, 0, 2, 1, 1)

        self.login_button = QtWidgets.QPushButton()
        font = QtGui.QFont()
        self.login_button.setFont(font)
        self.login_button.setObjectName("login_button")
        self.login_button.setText("登录AGV")

        grid_layout.addWidget(self.login_button, 1, 0, 1, 3)

        self.scroll_area = QtWidgets.QScrollArea()
        self.scroll_area.setWidgetResizable(True)
        self.scroll_content = QtWidgets.QWidget()
        self.scroll_layout = QtWidgets.QVBoxLayout(self.scroll_content)

        self.add_buttons_to_scroll_area(self.scroll_layout)

        self.scroll_area.setWidget(self.scroll_content)
        self.scroll_area.setStyleSheet("background-color: #d3efff")  # 设置背景颜色
        grid_layout.addWidget(self.scroll_area, 2, 0, 1, 3)

        login_window.setCentralWidget(self.centralwidget)

        QtCore.QMetaObject.connectSlotsByName(login_window)

    def add_buttons_to_scroll_area(self, layout):
        """添加更多按钮到滚动区域"""
        for i in range(20):
            button = QtWidgets.QPushButton(f"button_{i}")
            button.setObjectName(f"button_{i}")
            button.setStyleSheet("text-align: left;padding-left:5px;")  # 设置文本对齐方式为左对齐
            button.clicked.connect(self.button_clicked)
            layout.addWidget(button)

    def button_clicked(self):
        sender = self.sender()
        button_text = sender.text()
        print(f"Button clicked: {button_text}")

pyqt_login-master/Windows/login.py.04.txt

from PyQt6 import QtCore, QtGui, QtWidgets

user_icon = "assets/favicon.ico"


class MainWindow(object):
    """Login window definition"""

    def set_ui(self, login_window):
        """_summary_

        Args:
            login_window (_type_): _description_
        """
        login_window.setObjectName("login_window")
        login_window.resize(291, 160)
        login_window.setTabShape(QtWidgets.QTabWidget.TabShape.Rounded)
        login_window.setWindowIcon(QtGui.QIcon(user_icon))

        self.centralwidget = QtWidgets.QWidget(login_window)
        self.centralwidget.setObjectName("centralwidget")

        vertical_layout = QtWidgets.QVBoxLayout(self.centralwidget)

        horizontal_layout = QtWidgets.QHBoxLayout()
        vertical_layout.addLayout(horizontal_layout)

        self.login_button = QtWidgets.QPushButton()
        font = QtGui.QFont()
        font.setFamily("Nunito Sans")
        self.login_button.setFont(font)
        self.login_button.setObjectName("login_button")
        horizontal_layout.addWidget(self.login_button)

        self.save_button = QtWidgets.QPushButton()
        self.save_button.setObjectName("save_button")
        horizontal_layout.addWidget(self.save_button)

        self.user_input = QtWidgets.QLineEdit()
        font = QtGui.QFont()
        font.setFamily("Nunito Sans")
        self.user_input.setFont(font)
        self.user_input.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
        self.user_input.setObjectName("user_input")
        vertical_layout.addWidget(self.user_input)

        self.password_input = QtWidgets.QLineEdit()
        font = QtGui.QFont()
        font.setFamily("Nunito Sans")
        self.password_input.setFont(font)
        self.password_input.setEchoMode(QtWidgets.QLineEdit.EchoMode.Password)
        self.password_input.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
        self.password_input.setObjectName("password_input")
        vertical_layout.addWidget(self.password_input)

        login_window.setCentralWidget(self.centralwidget)

        self.retranslate_ui(login_window)
        QtCore.QMetaObject.connectSlotsByName(login_window)

    def retranslate_ui(self, login_window):
        translate = QtCore.QCoreApplication.translate
        login_window.setWindowTitle(translate("login_window", "AGV"))
        self.login_button.setText(translate("login_window", "登录AGV"))
        self.save_button.setText(translate("login_window", "保存密码"))
        self.user_input.setPlaceholderText(translate("login_window", "请输入账号"))
        self.password_input.setPlaceholderText(translate("login_window", "请输入密码"))

pyqt_login-master/Windows/login.py.06.txt

from PyQt6 import QtCore, QtGui, QtWidgets

user_icon = "assets/favicon.ico"


class MainWindow(object):
    """Login window definition"""

    def set_ui(self, login_window):
        """_summary_

        Args:
            login_window (_type_): _description_
        """
        login_window.setObjectName("login_window")
        login_window.resize(291, 400)
        login_window.setTabShape(QtWidgets.QTabWidget.TabShape.Rounded)
        login_window.setWindowIcon(QtGui.QIcon(user_icon))

        self.centralwidget = QtWidgets.QWidget(login_window)
        self.centralwidget.setObjectName("centralwidget")

        grid_layout = QtWidgets.QGridLayout(self.centralwidget)

        self.scroll_area = QtWidgets.QScrollArea(self.centralwidget)
        self.scroll_area.setWidgetResizable(True)

        scroll_content = QtWidgets.QWidget()
        scroll_layout = QtWidgets.QVBoxLayout(scroll_content)

        self.login_button = QtWidgets.QPushButton()
        font = QtGui.QFont()
        font.setFamily("Nunito Sans")
        self.login_button.setFont(font)
        self.login_button.setObjectName("login_button")
        scroll_layout.addWidget(self.login_button)

        self.user_input = QtWidgets.QLineEdit()
        font = QtGui.QFont()
        font.setFamily("Nunito Sans")
        self.user_input.setFont(font)
        self.user_input.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
        self.user_input.setObjectName("user_input")
        scroll_layout.addWidget(self.user_input)

        self.password_input = QtWidgets.QLineEdit()
        font = QtGui.QFont()
        font.setFamily("Nunito Sans")
        self.password_input.setFont(font)
        self.password_input.setEchoMode(QtWidgets.QLineEdit.EchoMode.Password)
        self.password_input.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
        self.password_input.setObjectName("password_input")
        scroll_layout.addWidget(self.password_input)

        self.save_button = QtWidgets.QPushButton()
        self.save_button.setObjectName("save_button")
        scroll_layout.addWidget(self.save_button)

        self.add_buttons_to_scroll_area(scroll_layout)  # 添加更多按钮到滚动区域

        self.scroll_area.setWidget(scroll_content)
        grid_layout.addWidget(self.scroll_area, 0, 0, 1, 3)

        login_window.setCentralWidget(self.centralwidget)

        self.retranslate_ui(login_window)
        QtCore.QMetaObject.connectSlotsByName(login_window)

    def retranslate_ui(self, login_window):
        translate = QtCore.QCoreApplication.translate
        login_window.setWindowTitle(translate("login_window", "AGV"))
        self.login_button.setText(translate("login_window", "登录AGV"))
        self.save_button.setText(translate("login_window", "保存密码"))
        self.user_input.setPlaceholderText(translate("login_window", "请输入账号"))
        self.password_input.setPlaceholderText(translate("login_window", "请输入密码"))

    def add_buttons_to_scroll_area(self, layout):
        """添加更多按钮到滚动区域"""
        for i in range(10):
            button = QtWidgets.QPushButton(f"Button {i+1}")
            layout.addWidget(button)


# app = QtWidgets.QApplication([])
# window = QtWidgets.QMainWindow()
# ui = MainWindow()
# ui.set_ui(window)
# window.show()
# app.exec()

pyqt_login-master/Windows/login.py.03.txt

from PyQt6 import QtCore, QtGui, QtWidgets

user_icon = "assets/favicon.ico"


class MainWindow(object):
    """Login window definition"""

    def set_ui(self, login_window):
        """_summary_

        Args:
            login_window (_type_): _description_
        """
        login_window.setObjectName("login_window")
        login_window.resize(291, 160)
        login_window.setTabShape(QtWidgets.QTabWidget.TabShape.Rounded)
        login_window.setWindowIcon(QtGui.QIcon(user_icon))

        self.centralwidget = QtWidgets.QWidget(login_window)
        self.centralwidget.setObjectName("centralwidget")

        layout = QtWidgets.QVBoxLayout(self.centralwidget)

        self.login_button = QtWidgets.QPushButton()
        font = QtGui.QFont()
        font.setFamily("Nunito Sans")
        self.login_button.setFont(font)
        self.login_button.setObjectName("login_button")
        layout.addWidget(self.login_button)

        self.save_button = QtWidgets.QPushButton()
        self.save_button.setObjectName("save_button")
        layout.addWidget(self.save_button)

        self.user_input = QtWidgets.QLineEdit()
        font = QtGui.QFont()
        font.setFamily("Nunito Sans")
        self.user_input.setFont(font)
        self.user_input.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
        self.user_input.setObjectName("user_input")
        layout.addWidget(self.user_input)

        self.password_input = QtWidgets.QLineEdit()
        font = QtGui.QFont()
        font.setFamily("Nunito Sans")
        self.password_input.setFont(font)
        self.password_input.setEchoMode(QtWidgets.QLineEdit.EchoMode.Password)
        self.password_input.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
        self.password_input.setObjectName("password_input")
        layout.addWidget(self.password_input)

        login_window.setCentralWidget(self.centralwidget)

        self.retranslate_ui(login_window)
        QtCore.QMetaObject.connectSlotsByName(login_window)

    def retranslate_ui(self, login_window):
        translate = QtCore.QCoreApplication.translate
        login_window.setWindowTitle(translate("login_window", "AGV"))
        self.login_button.setText(translate("login_window", "登录AGV"))
        self.save_button.setText(translate("login_window", "保存密码"))
        self.user_input.setPlaceholderText(translate("login_window", "请输入账号"))
        self.password_input.setPlaceholderText(translate("login_window", "请输入密码"))

pyqt_login-master/Windows/login.py.02.txt

from PyQt6 import QtCore, QtGui, QtWidgets

user_icon = "assets/favicon.ico"


class MainWindow(object):
    """Login window definition"""

    def set_ui(self, login_window):
        """_summary_

        Args:
            login_window (_type_): _description_
        """
        login_window.setObjectName("login_window")
        login_window.resize(291, 800)
        login_window.setTabShape(QtWidgets.QTabWidget.TabShape.Rounded)
        login_window.setWindowIcon(QtGui.QIcon(user_icon))

        self.centralwidget = QtWidgets.QWidget(login_window)
        self.centralwidget.setObjectName("centralwidget")

        self.login_button = QtWidgets.QPushButton(self.centralwidget)
        self.login_button.setGeometry(QtCore.QRect(10, 10, 271, 31))
        font = QtGui.QFont()
        font.setFamily("Nunito Sans")
        self.login_button.setFont(font)
        self.login_button.setObjectName("login_button")

        self.save_button = QtWidgets.QPushButton(self.centralwidget)
        self.save_button.setGeometry(QtCore.QRect(10, 110, 271, 31))
        self.save_button.setObjectName("save_button")

        self.user_input = QtWidgets.QLineEdit(self.centralwidget)
        self.user_input.setGeometry(QtCore.QRect(10, 50, 271, 25))
        font = QtGui.QFont()
        font.setFamily("Nunito Sans")
        self.user_input.setFont(font)
        self.user_input.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
        self.user_input.setObjectName("user_input")

        self.password_input = QtWidgets.QLineEdit(self.centralwidget)
        self.password_input.setGeometry(QtCore.QRect(10, 80, 271, 25))
        font = QtGui.QFont()
        font.setFamily("Nunito Sans")
        self.password_input.setFont(font)
        self.password_input.setEchoMode(QtWidgets.QLineEdit.EchoMode.Password)
        self.password_input.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
        self.password_input.setObjectName("password_input")
        login_window.setCentralWidget(self.centralwidget)

        self.add_buttons(login_window)  # 添加按钮和滚动条

        self.retranslate_ui(login_window)
        QtCore.QMetaObject.connectSlotsByName(login_window)

    def add_buttons(self, login_window):
        scroll_area = QtWidgets.QScrollArea(login_window)
        scroll_area.setWidgetResizable(True)

        scroll_area.setGeometry(QtCore.QRect(10, 500, 271, 25))

        content_widget = QtWidgets.QWidget()
        scroll_area.setWidget(content_widget)

        layout = QtWidgets.QVBoxLayout(content_widget)

        for i in range(10):
            button = QtWidgets.QPushButton(f"Button {i+1}")
            layout.addWidget(button)

        self.centralwidget.setLayout(QtWidgets.QVBoxLayout())
        self.centralwidget.layout().addWidget(scroll_area)

    def retranslate_ui(self, login_window):
        translate = QtCore.QCoreApplication.translate
        login_window.setWindowTitle(translate("login_window", "AGV"))
        self.login_button.setText(translate("login_window", "登录AGV"))
        self.save_button.setText(translate("login_window", "保存密码"))
        self.user_input.setPlaceholderText(translate("login_window", "请输入账号"))
        self.password_input.setPlaceholderText(translate("login_window", "请输入密码"))

pyqt_login-master/assets/style.css

QLabel
{
    color: grey;
}

#centralwidget, QMessageBox
{
    background-color: #d3efff;
}

QScrollArea{
    background-color: #d3efff;
}

QScrollArea QPushButton{
    background-color: #409efe;
    margin:0px 10px;
}

QPushButton
{
    color: gray;
    border: 1px solid #409efe;
    border-radius: 10;
}

QPushButton:hover:!pressed
{
    border-color: green;
}

QLineEdit
{
    border: 1px solid #409efe;
    border-radius: 10;
}

标签:窗口,登录,self,pyqt6,QtWidgets,window,input,login,button
From: https://www.cnblogs.com/zhuoss/p/17892961.html

相关文章

  • PHP中cookie,session的使用和用户自动登录的实现
    cookie的使用//生成cookie//注释:setcookie()函数必须位于<html>标签之前。//setcookie(name,value,expire,path,domain);//名称,值,过期时间,有效路径,有效域名//path,可选;如果路径设置为"/",那么cookie将在整个域名内有效.如果路径设置为"/test/",那么cookie将在test......
  • bbs 注册登录 验证
    注册页面 -用户名-密码-确认密码-邮箱-手机号-头像#form组件可以帮助我们 1快速生成前端页面2数据校验3错误处理#如何使用 -1写一个类,继承forms.Form-2在类中写属性和方法 -属性:要跟咱们要校验或自动生成页面的字段一一对应......
  • 为什么ESP-idf这个powershell窗口有时会打不开,有人遇到过这个问题吗
    ESP-IDF,全称EspressifIoTDevelopmentFramework,是乐鑫官方的物联网开发框架。它主要适用于ESP32、ESP32-S、ESP32-C和ESP32-H系列SoC的开发。此外,它还基于C/C++语言提供了一个自给自足的软件开发工具包(SDK),为用户在这些平台上开发通用应用程序提供了方便。同时,ESP-IDF支持多种网络......
  • SpringBoot项目之Kaptcha实现登录验证码
    一、pom.xml加载该依赖<dependency><groupId>com.github.axet</groupId><artifactId>kaptcha</artifactId><version>0.0.9</version></dependency>二、RestFul风格,在这里写一个调用验证码的接口:@GetMapping(value="/captcha.......
  • 使用selenium的edge浏览器登录某为
    互联网上基本都是某哥的用法,其实edge和某哥的用法是一样的就有一下参数不一样。一、运行环境Python:3.7Selenium:4.11.2Edge:版本120.0.2210.61(正式版本)(64位)编辑二、执行代码fromtimeimportsleepfromseleniumimportwebdriver#在这里导入浏览器设置相关的类fromse......
  • 『江鸟中原』鸿蒙——设计聊天软件界面并实现登录跳转
    环境搭建软件要求 DevEcoStudio版本:DevEcoStudio4.0Beta1BuildVersion:4.0.0.201,builtonJune10,2023。 HarmonyOSSDK版本:APIversion9。硬件要求设备类型:华为手机或运行在DevEcoStudio上的华为手机设备模拟器。HarmonyOS系统:3.1.0DeveloperRelease。简要介......
  • maven 配置(cmd 黑窗口执行 mvn 时默认的 settings 文件和 idea maven 相关配置)
    写在前面:本文章用于记录博主平时遇到的问题,步骤略粗糙,目的在于记录一边后续博主自己查找,如果能帮助到其他人更好。文章中用到的链接均为自行引入,侵删,谢谢(2I2Rc*@JY8)问题说明:在一次使用cmdmvn命令通过下载到本地的第三方jar包(ojdbc8.jar)创建本地maven仓库的文件结构时发现......
  • 13、QT窗口API函数基础知识
    QT窗口API函数geometry()用于获取窗口在屏幕上的几何位置和大小QRectgeo=widget->geometry();intx=geo.x();//窗口左上角的x坐标inty=geo.y();//窗口左上角的y坐标intw=geo.width();//窗口的宽度inth=geo.height();//窗口的高度width()函数返......
  • 双Token实现无感刷新登录状态
    基于access_token和refresh_token实现无感刷新登录状态双token原理 这是登录认证的流程:验证通过之后,将用户信息放到jwt中。 访问接口的时候带上jwt,在Guard里取出来判断是否有效,jwt有效的话才能继续访问:这种方式有个问题:jwt是有有效期的,我们设置的是7天,实际上为了安全......
  • 怎样改变VBA窗口字体大小?
    如下图所示:我们经常会通过右击工作表名称标签,点击【查看代码】命令(或按快捷键Alt+F11键)进入到VBA代码编辑器窗口,进行VBA代码的复制粘贴操作(或者手动编辑操作等)我们发现字体字号非常小,查看或者编辑时眼睛很累,容易造成输入错误等现象。  首先进入VBA代码编辑器窗口,点击上方的......