visheshnamdev72
Thursday, 2024-09-05
PyQt5 is a set of Python bindings for the Qt application framework, allowing developers to create cross-platform graphical user interfaces (GUIs) with Python. Qt is widely used for developing desktop applications due to its comprehensive set of features and modern UI components. PyQt5 enables Python developers to access these features and create fully functional desktop applications with Python.
A Simple GUI(Graphical user Interface) Design
import sys
from PyQt5.QtWidgets import QApplication, QLabel, QWidget
def main():
app = QApplication(sys.argv)
window = QWidget()
label = QLabel('Vishesh Namdev', window)
label.move(100,580)
window.setWindowTitle('TRC')
window.setGeometry(500,500,500,500)
window.show()
sys.exit(app.exec_())
if __name__ == '__main__':
main()
This PyQt5 code creates a simple GUI application:
QApplication: Initializes the app.QWidget: Creates the main window.QLabel: Adds a label with the text "Vishesh Namdev" at position (100, 580).window.show(): Displays the window.