{"id":329465,"date":"2022-02-12T09:00:25","date_gmt":"2022-02-12T09:00:25","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=329465"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=329465","title":{"rendered":"<span>PyQt5 \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0432\u0430\u0441 \u0445\u043e\u0447\u0443 \u043d\u0430\u0443\u0447\u0438\u0442\u044c \u0434\u0435\u043b\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043d\u0430 Python 3&amp;PyQt5.<\/p>\n<h2>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 PyQt5<\/h2>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c PyQt5 \u0432 Windows \u0438\u043b\u0438 MacOS, \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u041a\u043e\u043c\u0430\u043d\u0434\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0438\u043b\u0438 \u0422\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u0438 \u0432\u0432\u0435\u0434\u0438\u0442\u0435:<\/p>\n<pre><code class=\"powershell\">pip3 install PyQt5<\/code><\/pre>\n<p>\u0414\u043b\u044f Linux, \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0422\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u0438 \u0432\u0432\u0435\u0434\u0438\u0442\u0435:<\/p>\n<pre><code class=\"bash\">sudo apt-get update sudo apt-get upgrade sudo apt-get install python3-pyqt5<\/code><\/pre>\n<h2>Hello, World!<\/h2>\n<p>\u0410 \u0441\u0435\u0439\u0447\u0430\u0441 \u0441\u0434\u0435\u043b\u0430\u0435\u043c Hello World \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0444\u0430\u0439\u043b Python, \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0435\u0433\u043e \u0438 \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">from PyQt5.QtWidgets import * import sys   class MainWindow(QMainWindow): # \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u043e\u043a\u043d\u043e     def __init__(self, parent=None):         super().__init__(parent)         self.setupUi()     def setupUi(self):         self.setWindowTitle(\"Hello, world\") # \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043e\u043a\u043d\u0430         self.move(300, 300) # \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u043a\u043d\u0430         self.resize(200, 200) # \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u043a\u043d\u0430         self.lbl = QLabel('Hello, world!!!', self)         self.lbl.move(30, 30)   if __name__ == \"__main__\":     app = QApplication(sys.argv)     win = MainWindow()     win.show()     sys.exit(app.exec_())<\/code><\/pre>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435, \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u0430\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u0430:<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"\/img\/image-loader.svg\" alt=\"\u041e\u043a\u043d\u043e Hello, world \u043d\u0430 Ubuntu\" title=\"\u041e\u043a\u043d\u043e Hello, world \u043d\u0430 Ubuntu\" height=\"269\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/200\/b98\/672\/200b986722a3468928603ac3fbf2dd30.png\" data-width=\"234\"\/><figcaption>\u041e\u043a\u043d\u043e Hello, world \u043d\u0430 Ubuntu<\/figcaption><\/figure>\n<h2>\u041c\u0435\u043d\u044f\u0435\u043c \u0448\u0440\u0438\u0444\u0442 \u043d\u0430\u0434\u043f\u0438\u0441\u0438<\/h2>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u043c \u0448\u0440\u0438\u0444\u0442 \u043d\u0430\u0434\u043f\u0438\u0441\u0438. \u0422\u0435\u043f\u0435\u0440\u044c \u043a\u043e\u0434 \u0441\u0442\u0430\u043d\u0435\u0442 \u0442\u0430\u043a\u0438\u043c:<\/p>\n<pre><code class=\"python\">from PyQt5.QtWidgets import * from PyQt5.QtGui import * import sys   class MainWindow(QMainWindow): # \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u043e\u043a\u043d\u043e     def __init__(self, parent=None):         super().__init__(parent)         self.setupUi()     def setupUi(self):         self.setWindowTitle(\"Hello, world\") # \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043e\u043a\u043d\u0430         self.move(300, 300) # \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u043a\u043d\u0430         self.resize(200, 200) # \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u043a\u043d\u0430         self.lbl = QLabel('Hello, world!!!', self)         self.lbl.move(30, 30)         self.font = QFont() # \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u0448\u0440\u0438\u0444\u0442\u0430         self.font.setFamily(\"Rubik\") # \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0448\u0440\u0438\u0444\u0442\u0430         self.font.setPointSize(12) # \u0440\u0430\u0437\u043c\u0435\u0440 \u0448\u0440\u0438\u0444\u0442\u0430         self.font.setUnderline(True) # \u043f\u043e\u0434\u0447\u0451\u0440\u043a\u0438\u0432\u0430\u043d\u0438\u0435         self.lbl.setFont(self.font) # \u0437\u0430\u0434\u0430\u0451\u043c \u0448\u0440\u0438\u0444\u0442 \u043c\u0435\u0442\u043a\u0435   if __name__ == \"__main__\":     app = QApplication(sys.argv)     win = MainWindow()     win.show()     sys.exit(app.exec_()) <\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u0443\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0448\u0440\u0438\u0444\u0442 Rubik \u043e\u0442 Google Fonts. \u0415\u0441\u043b\u0438 \u043d\u0435\u0442, \u0435\u0433\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c <a href=\"https:\/\/fonts.google.com\/specimen\/Rubik\" rel=\"noopener noreferrer nofollow\">\u043e\u0442\u0441\u044e\u0434\u0430<\/a>.<\/p>\n<h3>\u0411\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u0430\u044f \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430 \u0441 XHTML<\/h3>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c XHTML. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043a:<\/p>\n<pre><code class=\"python\">from PyQt5.QtWidgets import * import sys   class MainWindow(QMainWindow): # \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u043e\u043a\u043d\u043e     def __init__(self, parent=None):         super().__init__(parent)         self.setupUi()     def setupUi(self):         self.setWindowTitle(\"Hello, world\") # \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043e\u043a\u043d\u0430         self.move(300, 300) # \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u043a\u043d\u0430         self.resize(200, 200) # \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u043a\u043d\u0430         self.lbl = QLabel('&lt;i>Hello&lt;\/i>, &lt;b>world&lt;\/b>!!! &lt;s>&lt;b>123&lt;\/b>&lt;\/s>', self)         self.lbl.move(30, 30)   if __name__ == \"__main__\":     app = QApplication(sys.argv)     win = MainWindow()     win.show()     sys.exit(app.exec_()) <\/code><\/pre>\n<p>\u0422\u0435, \u043a\u0442\u043e \u0445\u043e\u0442\u044f \u0431\u044b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u044e\u0442 XHTML, \u0437\u0430\u043c\u0435\u0442\u044f\u0442, \u0447\u0442\u043e \u043d\u0430\u0434\u043f\u0438\u0441\u044c Hello \u0441\u0434\u0435\u043b\u0430\u043d\u0430 \u043a\u0443\u0440\u0441\u0438\u0432\u043e\u043c, \u0441\u043b\u043e\u0432\u043e world &#8212; \u0436\u0438\u0440\u043d\u044b\u043c, \u0430 123 &#8212; \u0438 \u0432\u044b\u0447\u0435\u0440\u043a\u043d\u0443\u0442\u043e, \u0438 \u0436\u0438\u0440\u043d\u043e\u0435. <\/p>\n<details class=\"spoiler\">\n<summary>\u0428\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0430 \u043f\u043e XHTML<\/summary>\n<div class=\"spoiler__content\">\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p>&lt;b>123&lt;\/b><\/p>\n<\/td>\n<td>\n<p>\u0416\u0438\u0440\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>&lt;i>123&lt;\/i><\/p>\n<\/td>\n<td>\n<p>\u041a\u0443\u0440\u0438\u0432<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>&lt;u>123&lt;\/u><\/p>\n<\/td>\n<td>\n<p>\u041f\u043e\u0434\u0447\u0451\u0440\u043a\u0438\u0432\u0430\u043d\u0438\u0435<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>&lt;s>123&lt;\/s><\/p>\n<\/td>\n<td>\n<p>\u0412\u044b\u0447\u0451\u0440\u043a\u0438\u0432\u0430\u043d\u0438\u0435<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>&lt;code>123&lt;\/code><\/p>\n<\/td>\n<td>\n<p>\u041a\u043e\u0434 (\u043c\u043e\u043d\u043e\u0448\u0438\u0440\u043d\u044b\u043c \u0448\u0440\u0438\u0444\u0442\u043e\u043c)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>&lt;sup>123&lt;\/sup><\/p>\n<\/td>\n<td>\n<p>\u041d\u0430\u0434\u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>&lt;sub>123&lt;\/sub><\/p>\n<\/td>\n<td>\n<p>\u041f\u043e\u0434\u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>&lt;span style=&#187;font-size:16pt;&#187;>123&lt;\/span><\/p>\n<\/td>\n<td>\n<p>\u0420\u0430\u0437\u043c\u0435\u0440 \u0442\u0435\u043a\u0441\u0442\u0430 16 \u043f\u0443\u043d\u043a\u0442\u043e\u0432<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>&lt;span style=&#187;color:#cc0000;&#187;>123&lt;\/span><\/p>\n<\/td>\n<td>\n<p>\u041a\u0440\u0430\u0441\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>&lt;span style=&#187; background-color:#00ff00;&#187;>123&lt;\/span><\/p>\n<\/td>\n<td>\n<p>\u0422\u0435\u043a\u0441\u0442 \u043d\u0430 \u044f\u0440\u043a\u043e-\u0437\u0435\u043b\u0451\u043d\u043e\u043c \u0444\u043e\u043d\u0435.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>&lt;span align=&#187;center&#187;>123&lt;\/span><\/p>\n<\/td>\n<td>\n<p>\u0412\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435 \u043f\u043e \u0446\u0435\u043d\u0442\u0440\u0443<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/details>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u044f \u0437\u043d\u0430\u044e \u0442\u0430\u043a\u043e\u0439 <a href=\"http:\/\/blockly.ru\/blockly-html\/index.html\" rel=\"noopener noreferrer nofollow\">\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440<\/a> HTML. \u041b\u0438\u0447\u043d\u043e \u043c\u043d\u0435 \u043e\u043d \u043f\u043e \u0434\u0443\u0448\u0435. \u0422\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0432\u043e\u0438 \u0442\u044d\u0433\u0438.<\/p>\n<h2>\u0411\u043e\u043b\u044c\u0448\u0435 \u043d\u0430\u0434\u043f\u0438\u0441\u0435\u0439!<\/h2>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u0434\u0435\u043b\u0430\u0435\u043c 2 \u043d\u0430\u0434\u043f\u0438\u0441\u0438:<\/p>\n<pre><code class=\"python\">from PyQt5.QtWidgets import * import sys   class MainWindow(QMainWindow): # \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u043e\u043a\u043d\u043e     def __init__(self, parent=None):         super().__init__(parent)         self.setupUi()     def setupUi(self):         self.setWindowTitle(\"Hello, world\") # \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043e\u043a\u043d\u0430         self.move(300, 300) # \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u043a\u043d\u0430         self.resize(200, 200) # \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u043a\u043d\u0430         self.lbl = QLabel('&lt;i>Hello&lt;\/i>, &lt;b>world&lt;\/b>!!!', self)         self.lbl.move(30, 30)         self.lbl2 = QLabel('&lt;u>\u0415\u0449\u0451 \u043e\u0434\u043d\u0430 \u043c\u0435\u0442\u043a\u0430&lt;\/u>', self)         self.lbl2.move(50, 50)   if __name__ == \"__main__\":     app = QApplication(sys.argv)     win = MainWindow()     win.show()     sys.exit(app.exec_())<\/code><\/pre>\n<p>\u041d\u0430 \u0432\u0442\u043e\u0440\u0443\u044e \u044f \u0442\u043e\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 (\u043f\u043e\u0434\u0447\u0451\u0440\u043a\u0438\u0432\u0430\u043d\u0438\u0435), \u0430 \u0443 \u043f\u0435\u0440\u0432\u043e\u0439 \u0443\u0431\u0440\u0430\u043b 123.<\/p>\n<h3>\u041e\u043a\u043d\u043e \u0431\u0435\u0437 resize()<\/h3>\n<p>\u0412\u0441\u0435 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0442\u0430\u043a\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e:<\/p>\n<pre><code class=\"python\">self.resize(200, 200)<\/code><\/pre>\n<p>\u041d\u043e \u0431\u0435\u0437 \u044d\u0442\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u0438\u0434\u0436\u0435\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u0441\u0430\u043c\u0438 \u0441\u0435\u0431\u0435 \u0440\u0430\u0441\u0447\u0438\u0449\u0430\u0442\u044c \u043c\u0435\u0441\u0442\u043e.<\/p>\n<h3>\u041f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0438<\/h3>\n<p>\u041a\u043e \u0432\u0441\u0435\u043c \u0432\u0438\u0434\u0436\u0435\u0442\u0430\u043c \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0443. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 (\u043f\u0440\u0438\u0432\u043e\u0436\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0436\u043d\u0443\u044e \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430):<\/p>\n<pre><code class=\"python\">self.lbl.setToolTip('This is a &lt;b>QLabel&lt;\/b>')<\/code><\/pre>\n<h3>\u042d\u043f\u0438\u043b\u043e\u0433<\/h3>\n<p>\u0412\u043e\u0442 \u0438 \u0432\u0441\u0451. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0438, \u043c\u0435\u043d\u044e \u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f.<\/p>\n<p>\u0414\u043e \u043d\u043e\u0432\u044b\u0445 \u0432\u0441\u0442\u0440\u0435\u0447!<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/651093\/\"> https:\/\/habr.com\/ru\/post\/651093\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0432\u0430\u0441 \u0445\u043e\u0447\u0443 \u043d\u0430\u0443\u0447\u0438\u0442\u044c \u0434\u0435\u043b\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043d\u0430 Python 3&amp;PyQt5.<\/p>\n<h2>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 PyQt5<\/h2>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c PyQt5 \u0432 Windows \u0438\u043b\u0438 MacOS, \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u041a\u043e\u043c\u0430\u043d\u0434\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0438\u043b\u0438 \u0422\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u0438 \u0432\u0432\u0435\u0434\u0438\u0442\u0435:<\/p>\n<pre><code class=\"powershell\">pip3 install PyQt5<\/code><\/pre>\n<p>\u0414\u043b\u044f Linux, \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0422\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u0438 \u0432\u0432\u0435\u0434\u0438\u0442\u0435:<\/p>\n<pre><code class=\"bash\">sudo apt-get update sudo apt-get upgrade sudo apt-get install python3-pyqt5<\/code><\/pre>\n<h2>Hello, World!<\/h2>\n<p>\u0410 \u0441\u0435\u0439\u0447\u0430\u0441 \u0441\u0434\u0435\u043b\u0430\u0435\u043c Hello World \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0444\u0430\u0439\u043b Python, \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0435\u0433\u043e \u0438 \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">from PyQt5.QtWidgets import * import sys   class MainWindow(QMainWindow): # \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u043e\u043a\u043d\u043e     def __init__(self, parent=None):         super().__init__(parent)         self.setupUi()     def setupUi(self):         self.setWindowTitle(\"Hello, world\") # \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043e\u043a\u043d\u0430         self.move(300, 300) # \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u043a\u043d\u0430         self.resize(200, 200) # \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u043a\u043d\u0430         self.lbl = QLabel('Hello, world!!!', self)         self.lbl.move(30, 30)   if __name__ == \"__main__\":     app = QApplication(sys.argv)     win = MainWindow()     win.show()     sys.exit(app.exec_())<\/code><\/pre>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435, \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u0430\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u0430:<\/p>\n<figure class=\"\"><figcaption>\u041e\u043a\u043d\u043e Hello, world \u043d\u0430 Ubuntu<\/figcaption><\/figure>\n<h2>\u041c\u0435\u043d\u044f\u0435\u043c \u0448\u0440\u0438\u0444\u0442 \u043d\u0430\u0434\u043f\u0438\u0441\u0438<\/h2>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u043c \u0448\u0440\u0438\u0444\u0442 \u043d\u0430\u0434\u043f\u0438\u0441\u0438. \u0422\u0435\u043f\u0435\u0440\u044c \u043a\u043e\u0434 \u0441\u0442\u0430\u043d\u0435\u0442 \u0442\u0430\u043a\u0438\u043c:<\/p>\n<pre><code class=\"python\">from PyQt5.QtWidgets import * from PyQt5.QtGui import * import sys   class MainWindow(QMainWindow): # \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u043e\u043a\u043d\u043e     def __init__(self, parent=None):         super().__init__(parent)         self.setupUi()     def setupUi(self):         self.setWindowTitle(\"Hello, world\") # \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043e\u043a\u043d\u0430         self.move(300, 300) # \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u043a\u043d\u0430         self.resize(200, 200) # \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u043a\u043d\u0430         self.lbl = QLabel('Hello, world!!!', self)         self.lbl.move(30, 30)         self.font = QFont() # \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u0448\u0440\u0438\u0444\u0442\u0430         self.font.setFamily(\"Rubik\") # \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0448\u0440\u0438\u0444\u0442\u0430         self.font.setPointSize(12) # \u0440\u0430\u0437\u043c\u0435\u0440 \u0448\u0440\u0438\u0444\u0442\u0430         self.font.setUnderline(True) # \u043f\u043e\u0434\u0447\u0451\u0440\u043a\u0438\u0432\u0430\u043d\u0438\u0435         self.lbl.setFont(self.font) # \u0437\u0430\u0434\u0430\u0451\u043c \u0448\u0440\u0438\u0444\u0442 \u043c\u0435\u0442\u043a\u0435   if __name__ == \"__main__\":     app = QApplication(sys.argv)     win = MainWindow()     win.show()     sys.exit(app.exec_()) <\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u0443\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0448\u0440\u0438\u0444\u0442 Rubik \u043e\u0442 Google Fonts. \u0415\u0441\u043b\u0438 \u043d\u0435\u0442, \u0435\u0433\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c <a href=\"https:\/\/fonts.google.com\/specimen\/Rubik\" rel=\"noopener noreferrer nofollow\">\u043e\u0442\u0441\u044e\u0434\u0430<\/a>.<\/p>\n<h3>\u0411\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u0430\u044f \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430 \u0441 XHTML<\/h3>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c XHTML. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043a:<\/p>\n<pre><code class=\"python\">from PyQt5.QtWidgets import * import sys   class MainWindow(QMainWindow): # \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u043e\u043a\u043d\u043e     def __init__(self, parent=None):         super().__init__(parent)         self.setupUi()     def setupUi(self):         self.setWindowTitle(\"Hello, world\") # \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043e\u043a\u043d\u0430         self.move(300, 300) # \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u043a\u043d\u0430         self.resize(200, 200) # \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u043a\u043d\u0430         self.lbl = QLabel('&lt;i>Hello&lt;\/i>, &lt;b>world&lt;\/b>!!! &lt;s>&lt;b>123&lt;\/b>&lt;\/s>', self)         self.lbl.move(30, 30)   if __name__ == \"__main__\":     app = QApplication(sys.argv)     win = MainWindow()     win.show()     sys.exit(app.exec_()) <\/code><\/pre>\n<p>\u0422\u0435, \u043a\u0442\u043e \u0445\u043e\u0442\u044f \u0431\u044b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u044e\u0442 XHTML, \u0437\u0430\u043c\u0435\u0442\u044f\u0442, \u0447\u0442\u043e \u043d\u0430\u0434\u043f\u0438\u0441\u044c Hello \u0441\u0434\u0435\u043b\u0430\u043d\u0430 \u043a\u0443\u0440\u0441\u0438\u0432\u043e\u043c, \u0441\u043b\u043e\u0432\u043e world &#8212; \u0436\u0438\u0440\u043d\u044b\u043c, \u0430 123 &#8212; \u0438 \u0432\u044b\u0447\u0435\u0440\u043a\u043d\u0443\u0442\u043e, \u0438 \u0436\u0438\u0440\u043d\u043e\u0435. <\/p>\n<details class=\"spoiler\">\n<summary>\u0428\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0430 \u043f\u043e XHTML<\/summary>\n<div class=\"spoiler__content\">\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p>&lt;b>123&lt;\/b><\/p>\n<\/td>\n<td>\n<p>\u0416\u0438\u0440\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>&lt;i>123&lt;\/i><\/p>\n<\/td>\n<td>\n<p>\u041a\u0443\u0440\u0438\u0432<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>&lt;u>123&lt;\/u><\/p>\n<\/td>\n<td>\n<p>\u041f\u043e\u0434\u0447\u0451\u0440\u043a\u0438\u0432\u0430\u043d\u0438\u0435<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>&lt;s>123&lt;\/s><\/p>\n<\/td>\n<td>\n<p>\u0412\u044b\u0447\u0451\u0440\u043a\u0438\u0432\u0430\u043d\u0438\u0435<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>&lt;code>123&lt;\/code><\/p>\n<\/td>\n<td>\n<p>\u041a\u043e\u0434 (\u043c\u043e\u043d\u043e\u0448\u0438\u0440\u043d\u044b\u043c \u0448\u0440\u0438\u0444\u0442\u043e\u043c)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>&lt;sup>123&lt;\/sup><\/p>\n<\/td>\n<td>\n<p>\u041d\u0430\u0434\u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>&lt;sub>123&lt;\/sub><\/p>\n<\/td>\n<td>\n<p>\u041f\u043e\u0434\u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>&lt;span style=&#187;font-size:16pt;&#187;>123&lt;\/span><\/p>\n<\/td>\n<td>\n<p>\u0420\u0430\u0437\u043c\u0435\u0440 \u0442\u0435\u043a\u0441\u0442\u0430 16 \u043f\u0443\u043d\u043a\u0442\u043e\u0432<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>&lt;span style=&#187;color:#cc0000;&#187;>123&lt;\/span><\/p>\n<\/td>\n<td>\n<p>\u041a\u0440\u0430\u0441\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>&lt;span style=&#187; background-color:#00ff00;&#187;>123&lt;\/span><\/p>\n<\/td>\n<td>\n<p>\u0422\u0435\u043a\u0441\u0442 \u043d\u0430 \u044f\u0440\u043a\u043e-\u0437\u0435\u043b\u0451\u043d\u043e\u043c \u0444\u043e\u043d\u0435.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>&lt;span align=&#187;center&#187;>123&lt;\/span><\/p>\n<\/td>\n<td>\n<p>\u0412\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435 \u043f\u043e \u0446\u0435\u043d\u0442\u0440\u0443<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/details>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u044f \u0437\u043d\u0430\u044e \u0442\u0430\u043a\u043e\u0439 <a href=\"http:\/\/blockly.ru\/blockly-html\/index.html\" rel=\"noopener noreferrer nofollow\">\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440<\/a> HTML. \u041b\u0438\u0447\u043d\u043e \u043c\u043d\u0435 \u043e\u043d \u043f\u043e \u0434\u0443\u0448\u0435. \u0422\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0432\u043e\u0438 \u0442\u044d\u0433\u0438.<\/p>\n<h2>\u0411\u043e\u043b\u044c\u0448\u0435 \u043d\u0430\u0434\u043f\u0438\u0441\u0435\u0439!<\/h2>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u0434\u0435\u043b\u0430\u0435\u043c 2 \u043d\u0430\u0434\u043f\u0438\u0441\u0438:<\/p>\n<pre><code class=\"python\">from PyQt5.QtWidgets import * import sys   class MainWindow(QMainWindow): # \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u043e\u043a\u043d\u043e     def __init__(self, parent=None):         super().__init__(parent)         self.setupUi()     def setupUi(self):         self.setWindowTitle(\"Hello, world\") # \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043e\u043a\u043d\u0430         self.move(300, 300) # \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u043a\u043d\u0430         self.resize(200, 200) # \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u043a\u043d\u0430         self.lbl = QLabel('&lt;i>Hello&lt;\/i>, &lt;b>world&lt;\/b>!!!', self)         self.lbl.move(30, 30)         self.lbl2 = QLabel('&lt;u>\u0415\u0449\u0451 \u043e\u0434\u043d\u0430 \u043c\u0435\u0442\u043a\u0430&lt;\/u>', self)         self.lbl2.move(50, 50)   if __name__ == \"__main__\":     app = QApplication(sys.argv)     win = MainWindow()     win.show()     sys.exit(app.exec_())<\/code><\/pre>\n<p>\u041d\u0430 \u0432\u0442\u043e\u0440\u0443\u044e \u044f \u0442\u043e\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 (\u043f\u043e\u0434\u0447\u0451\u0440\u043a\u0438\u0432\u0430\u043d\u0438\u0435), \u0430 \u0443 \u043f\u0435\u0440\u0432\u043e\u0439 \u0443\u0431\u0440\u0430\u043b 123.<\/p>\n<h3>\u041e\u043a\u043d\u043e \u0431\u0435\u0437 resize()<\/h3>\n<p>\u0412\u0441\u0435 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0442\u0430\u043a\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e:<\/p>\n<pre><code class=\"python\">self.resize(200, 200)<\/code><\/pre>\n<p>\u041d\u043e \u0431\u0435\u0437 \u044d\u0442\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u0438\u0434\u0436\u0435\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u0441\u0430\u043c\u0438 \u0441\u0435\u0431\u0435 \u0440\u0430\u0441\u0447\u0438\u0449\u0430\u0442\u044c \u043c\u0435\u0441\u0442\u043e.<\/p>\n<h3>\u041f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0438<\/h3>\n<p>\u041a\u043e \u0432\u0441\u0435\u043c \u0432\u0438\u0434\u0436\u0435\u0442\u0430\u043c \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0443. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 (\u043f\u0440\u0438\u0432\u043e\u0436\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0436\u043d\u0443\u044e \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430):<\/p>\n<pre><code class=\"python\">self.lbl.setToolTip('This is a &lt;b>QLabel&lt;\/b>')<\/code><\/pre>\n<h3>\u042d\u043f\u0438\u043b\u043e\u0433<\/h3>\n<p>\u0412\u043e\u0442 \u0438 \u0432\u0441\u0451. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0438, \u043c\u0435\u043d\u044e \u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f.<\/p>\n<p>\u0414\u043e \u043d\u043e\u0432\u044b\u0445 \u0432\u0441\u0442\u0440\u0435\u0447!<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/651093\/\"> https:\/\/habr.com\/ru\/post\/651093\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-329465","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/329465","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=329465"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/329465\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=329465"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=329465"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=329465"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}