<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[how to call Python file]]></title><description><![CDATA[<p dir="auto">Hi to all,<br />
i have the following code:</p>
<pre><code>import sys
from PyQt5.uic import loadUi
from PyQt5 import QtWidgets
from PyQt5.QtWidgets import QDialog, QApplication, QWidget

import mit_main_dispay

class LoginScreen(QDialog):
    def __init__(self):
        super(LoginScreen, self).__init__()
        loadUi("Style_Login_gui.ui", self)
        self.lineEdit_password.setEchoMode(QtWidgets.QLineEdit.Password)
        self.pushButton_login.clicked.connect(self.loginfunction)

    def loginfunction(self):
        username = self.lineEdit_username.text()
        password = self.lineEdit_password.text()

        if len(username) == 0 or len(password) == 0:
            self.label_massage.setText("Please input all fields.")
        else:
            if username == 'Aviv' and password == '1234':
                print("Successfully logged in")
                self.label_massage.setText("")
                MIT_main_win = mit_main_dispay.MIT_main()
                widget.addWidget(MIT_main_win)
                widget.setCurrentIndex(widget.currentIndex() + 1)
            else:
                self.label_massage.setText("Invalid username or password.")

# main:
app = QApplication(sys.argv)
Login = LoginScreen()
widget = QtWidgets.QStackedWidget()
widget.addWidget(Login)
widget.setFixedWidth(800)
widget.setFixedHeight(920)
widget.show()
try:
    sys.exit(app.exec_())
except:
    print("Exiting")
</code></pre>
<p dir="auto">in line 11 i want to call other file (my Login GUI) but i call to file that create by QT and not my update code <strong>(Style_Login_gui.py)</strong>:</p>
<pre><code># -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'Style_Login_gui.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again.  Do not edit this file unless you know what you are doing.


from PyQt5 import QtCore, QtGui, QtWidgets
import sys, res


class Ui_Form(object):
    def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(625, 565)
        Form.setWindowFlag(QtCore.Qt.FramelessWindowHint)
        Form.setAttribute(QtCore.Qt.WA_TranslucentBackground)
        self.widget = QtWidgets.QWidget(Form)
        self.widget.setGeometry(QtCore.QRect(30, 30, 550, 500))
        self.widget.setStyleSheet("QPushButton#pushButton{\n"
            "    background-color: qlineargradient(spread:pad, x1:0, y1:0.505682, x2:1, y2:0.477, stop:0 rgba(11, 131, 120, 219), stop:1 rgba(85, 98, 112, 226));\n"
            "    color: rgba(255, 255, 255, 210);\n"
            "    border-radius: 5px;\n"
            "}\n"
            "\n"
            "QPushButton#pushButton:hover{\n"
            "    background-color: qlineargradient(spread:pad, x1:0, y1:0.505682, x2:1, y2:0.477, stop:0 rgba(150, 123, 111, 219), stop:1 rgba(85, 81, 84, 226));    \n"
            "}\n"
            "\n"
            "QPushButton#pushButton:pressed{\n"
            "    padding-left:5px;\n"
            "    padding-top:5px;\n"
            "    background-color:rgba(150, 123, 111,255);\n"
            "}\n"
            "\n"
            "\n"
            "\n"
            "")
        self.widget.setObjectName("widget")
        self.label = QtWidgets.QLabel(self.widget)
        self.label.setGeometry(QtCore.QRect(40, 30, 280, 430))
        self.label.setStyleSheet("border-image: url(C:/python_projects/MIT_project/Pics/best-Mac-wallpapers-apps.jpg);\n"
            "border-top-left-radius: 50px;\n"
            "\n"
            "")
        self.label.setText("")
        self.label.setObjectName("label")
        self.label_2 = QtWidgets.QLabel(self.widget)
        self.label_2.setGeometry(QtCore.QRect(270, 30, 240, 430))
        self.label_2.setStyleSheet("border-bottom-right-radius: 50px;\n"
            "background-color: rgba(255, 255, 255, 255);")
        self.label_2.setText("")
        self.label_2.setObjectName("label_2")
        self.label_3 = QtWidgets.QLabel(self.widget)
        self.label_3.setGeometry(QtCore.QRect(340, 80, 100, 40))
        font = QtGui.QFont()
        font.setPointSize(20)
        font.setBold(True)
        font.setWeight(75)
        self.label_3.setFont(font)
        self.label_3.setStyleSheet("color: rgba(0, 0, 0, 200);")
        self.label_3.setObjectName("label_3")
        self.lineEdit = QtWidgets.QLineEdit(self.widget)
        self.lineEdit.setGeometry(QtCore.QRect(295, 150, 190, 40))
        font = QtGui.QFont()
        font.setPointSize(10)
        self.lineEdit.setFont(font)
        self.lineEdit.setStyleSheet("background-color: rgba(0, 0, 0, 0);\n"
            "border:nane;\n"
            "border-bottom:2px solid rgba(46,82,101,200);\n"
            "color:rgba(0,0,0,240);\n"
            "padding-bottom:7px;")
        self.lineEdit.setObjectName("lineEdit")
        self.lineEdit_2 = QtWidgets.QLineEdit(self.widget)
        self.lineEdit_2.setGeometry(QtCore.QRect(295, 215, 190, 40))
        font = QtGui.QFont()
        font.setPointSize(10)
        self.lineEdit_2.setFont(font)
        self.lineEdit_2.setStyleSheet("background-color: rgba(0, 0, 0, 0);\n"
            "border:nane;\n"
            "border-bottom:2px solid rgba(46,82,101,200);\n"
            "color:rgba(0,0,0,240);\n"
            "padding-bottom:7px;")
        self.lineEdit_2.setEchoMode(QtWidgets.QLineEdit.Password)
        self.lineEdit_2.setObjectName("lineEdit_2")
        self.pushButton = QtWidgets.QPushButton(self.widget)
        self.pushButton.setGeometry(QtCore.QRect(295, 295, 190, 40))
        font = QtGui.QFont()
        font.setPointSize(11)
        font.setBold(True)
        font.setWeight(75)
        self.pushButton.setFont(font)
        self.pushButton.setStyleSheet("")
        self.pushButton.setObjectName("pushButton")
        self.label_4 = QtWidgets.QLabel(self.widget)
        self.label_4.setGeometry(QtCore.QRect(300, 340, 181, 31))
        self.label_4.setStyleSheet("color:rgba(0, 0, 0, 210);")
        self.label_4.setObjectName("label_4")
        self.label_5 = QtWidgets.QLabel(self.widget)
        self.label_5.setGeometry(QtCore.QRect(40, 90, 230, 130))
        self.label_5.setStyleSheet("background-color:rgba(0, 0, 0, 75);")
        self.label_5.setText("")
        self.label_5.setObjectName("label_5")
        self.label_6 = QtWidgets.QLabel(self.widget)
        self.label_6.setGeometry(QtCore.QRect(50, 80, 180, 40))
        font = QtGui.QFont()
        font.setPointSize(22)
        font.setBold(True)
        font.setWeight(75)
        self.label_6.setFont(font)
        self.label_6.setStyleSheet("color:rgba(255, 255, 255, 255);")
        self.label_6.setObjectName("label_6")
        self.label_7 = QtWidgets.QLabel(self.widget)
        self.label_7.setGeometry(QtCore.QRect(50, 145, 220, 50))
        font = QtGui.QFont()
        font.setPointSize(10)
        font.setBold(True)
        font.setWeight(75)
        self.label_7.setFont(font)
        self.label_7.setStyleSheet("color:rgba(255, 255, 255, 255);")
        self.label_7.setObjectName("label_7")

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)

    def retranslateUi(self, Form):
        _translate = QtCore.QCoreApplication.translate
        Form.setWindowTitle(_translate("Form", "Form"))
        self.label_3.setText(_translate("Form", "Log In"))
        self.lineEdit.setPlaceholderText(_translate("Form", "User Name"))
        self.lineEdit_2.setPlaceholderText(_translate("Form", "Password"))
        self.pushButton.setText(_translate("Form", "L o g I n"))
        self.label_4.setText(_translate("Form", "Forgot your User Name or Password?"))
        self.label_6.setText(_translate("Form", "MIT APP"))
        self.label_7.setText(_translate("Form", "Hi, \n"
            "Welcome to FPGA team \n"
            "register tool."))

if __name__ == "__main__":
    app = QtWidgets.QApplication(sys.argv)
    Form = QtWidgets.QWidget()
    ui = Ui_Form()
    ui.setupUi(Form)
    Form.show()
    sys.exit(app.exec_())

</code></pre>
<p dir="auto">what i miss?</p>
<p dir="auto">thanks.</p>
]]></description><link>https://forum.qt.io/topic/142992/how-to-call-python-file</link><generator>RSS for Node</generator><lastBuildDate>Tue, 23 Jun 2026 02:27:18 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/142992.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 16 Feb 2023 06:39:13 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to how to call Python file on Thu, 16 Feb 2023 14:36:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/avivy">@<bdi>AvivY</bdi></a><br />
Sorry, don't know what you mean.  Neither a <code>.ui</code> nor a <code>.py</code> file can be "called".</p>
<p dir="auto">What is "line 11", of which file, anyway?  And what does it do/not do that you want?</p>
]]></description><link>https://forum.qt.io/post/747970</link><guid isPermaLink="true">https://forum.qt.io/post/747970</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Thu, 16 Feb 2023 14:36:27 GMT</pubDate></item><item><title><![CDATA[Reply to how to call Python file on Thu, 16 Feb 2023 13:24:56 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a>,<br />
first thanks for your replay.</p>
<p dir="auto">what i means - line 11 work but it call to <strong>Style_Login_gui.ui</strong> and not to <strong>Style_Login_gui.py</strong>.</p>
<p dir="auto">what i need to write to call to <strong>Style_Login_gui.py</strong>?</p>
<p dir="auto">thanks.</p>
]]></description><link>https://forum.qt.io/post/747949</link><guid isPermaLink="true">https://forum.qt.io/post/747949</guid><dc:creator><![CDATA[AvivY]]></dc:creator><pubDate>Thu, 16 Feb 2023 13:24:56 GMT</pubDate></item><item><title><![CDATA[Reply to how to call Python file on Thu, 16 Feb 2023 09:41:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/avivy">@<bdi>AvivY</bdi></a> said in <a href="/post/747883">how to call Python file</a>:</p>
<blockquote>
<p dir="auto">in line 11 i want to call other file (my Login GUI) but i call to file that create by QT and not my update code (Style_Login_gui.py):</p>
</blockquote>
<p dir="auto">What does this mean?</p>
<p dir="auto">You seem to have a dialog which you choose to show in a stacked widget.  Slightly odd but I imagine it "works".</p>
]]></description><link>https://forum.qt.io/post/747914</link><guid isPermaLink="true">https://forum.qt.io/post/747914</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Thu, 16 Feb 2023 09:41:26 GMT</pubDate></item></channel></rss>