D
D
DastM2019-01-17 21:51:22
Python
DastM, 2019-01-17 21:51:22

How to add your Python code to PyQt to make an application?

Good evening everyone. Lamer, what can I do ....
Tell me good people)
There are several programs on .py, I want to connect it with PyQt for Linux and Windows.
How to design is more or less clear, but how to connect with the code is not clear.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Derevianko Alexander, 2019-01-25
@dio4

In so, for example, and add:
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# The program shows an empty window that has the basic
# functions of resizing,
# minimizing, maximizing:
import sys
from PyQt4.QtGui import * # interface components
# Each the application must create a QApplication object
# sys.argv is a list of command line arguments
application = QApplication(sys.argv)
# QWidget is the base class for all user interface
# objects; if you use a widget constructor
# without a parent, this widget will become a window
widget = QWidget()
widget.resize(320, 240) # resize the widget
widget.setWindowTitle(u"Hello everyone!") # set the title
widget.show() # show the window on the screen
sys.exit(application.exec_()) # start the main application loop

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question