{"id":295965,"date":"2019-12-18T09:00:14","date_gmt":"2019-12-18T09:00:14","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=295965"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=295965","title":{"rendered":"\u041f\u0438\u0448\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0438\u0433\u0440\u0443 \u043d\u0430 python"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/480906\/\">\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432\u0441\u0435\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0443\u044e \u0438\u0433\u0440\u0443 \u043a\u0430\u043c\u0435\u043d\u044c, \u043d\u043e\u0436\u043d\u0438\u0446\u044b, \u0431\u0443\u043c\u0430\u0433\u0430. \u0412 \u044d\u0442\u043e\u043c \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u042f\u041f python \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 tkinter, \u043d\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0437\u043d\u0430\u0435\u0442\u0435 \u0447\u0442\u043e \u044d\u0442\u043e \u0442\u0430\u043a\u043e\u0435, \u0441\u043e\u0432\u0435\u0442\u0443\u044e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u0443\u044e <a href=\"https:\/\/habr.com\/ru\/post\/133337\/\">\u0441\u0442\u0430\u0442\u044c\u044e.<\/a><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/2s\/wf\/jt\/2swfjtewp3uhp0mdhprpuzjqd-0.png\" \/><\/div>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e, \u044d\u0442\u043e \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430, \u043e\u043a\u043e\u0448\u043a\u043e, \u0443 \u043c\u0435\u043d\u044f \u043e\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">from tkinter import * import random as rdm   class Main(Frame):     def __init__(self, root):         super(Main, self).__init__(root)         self.startUI()      def startUI(self):         pass   if __name__ == '__main__':     root = Tk()     root.geometry(&quot;500x500+200+200&quot;)     root.title(&quot;\u041a\u0430\u043c\u0435\u043d\u044c, \u043d\u043e\u0436\u043d\u0438\u0446\u044b, \u0431\u0443\u043c\u0430\u0433\u0430&quot;)     root.resizable(False, False)     root[&quot;bg&quot;] = &quot;#FFF&quot;     app = Main(root)     app.pack()     root.mainloop() <\/code><\/pre>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0435 \u043e\u043a\u043d\u043e 500 \u043d\u0430 500 \u0441 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u043c \u00ab\u041a\u0430\u043c\u0435\u043d\u044c, \u043d\u043e\u0436\u043d\u0438\u0446\u044b, \u0431\u0443\u043c\u0430\u0433\u0430\u00bb \u0438 \u0431\u0435\u043b\u044b\u043c \u0444\u043e\u043d\u043e\u043c. \u0418\u043c\u0435\u043d\u043d\u043e \u0432 \u044d\u0442\u043e \u043e\u043a\u043e\u0448\u043a\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u043d\u043e\u043f\u043e\u0447\u043a\u0438, \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0438 \u0438 \u0442.\u0434.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432 \u043d\u0430\u0448 \u043c\u0435\u0442\u043e\u0434 <i>startUI<\/i> \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0442\u0430\u043a\u0438\u0435 \u0441\u0442\u0440\u043e\u0447\u043a\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">btn = Button(root, text=&quot;\u041a\u0430\u043c\u0435\u043d\u044c&quot;, font=(&quot;Times New Roman&quot;, 15)) btn = Button(root, text=&quot;\u041d\u043e\u0436\u043d\u0438\u0446\u044b&quot;, font=(&quot;Times New Roman&quot;, 15)) btn3 = Button(root, text=&quot;\u0411\u0443\u043c\u0430\u0433\u0430&quot;, font=(&quot;Times New Roman&quot;, 15))  btn.place(x=10, y=100, width=120, height=50) btn2.place(x=155, y=100, width=120, height=50) btn3.place(x=300, y=100, width=120, height=50) <\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u0438 7 \u0441\u0442\u0440\u043e\u0447\u0435\u043a \u0434\u043e\u0431\u0430\u0432\u044f\u0442 \u0432 \u043d\u0430\u0448\u0435 \u043e\u043a\u043d\u043e 3 \u043a\u043d\u043e\u043f\u043a\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u044e\u0442. \u041c\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043c \u044d\u0442\u043e \u043f\u043e\u0437\u0436\u0435.<\/p>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u0432\u043e\u0439 \u0432\u044b\u0431\u043e\u0440, \u043d\u0430\u0436\u0438\u043c\u0430\u044f \u043d\u0430 \u043e\u0434\u043d\u0443 \u0438\u0437 3 \u043a\u043d\u043e\u043f\u043e\u043a, \u044d\u0442\u043e \u043a\u0440\u0443\u0442\u043e, \u043d\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u043e\u043f\u043f\u043e\u043d\u0435\u043d\u0442, \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u0435\u043d \u043c\u043e\u0434\u0443\u043b\u044c random.<\/p>\n<p>\u0410 \u0432\u043e\u0442 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0432\u044b\u0431\u043e\u0440, \u0438 \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442, \u043a\u0442\u043e \u0436\u0435 \u0432\u044b\u0438\u0433\u0440\u0430\u043b \u0432 \u044d\u0442\u043e\u043c \u0440\u0430\u0443\u043d\u0434\u0435. \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e \u0432\u043e\u0442 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">btn = Button(root, text=&quot;\u041a\u0430\u043c\u0435\u043d\u044c&quot;, font=(&quot;Times New Roman&quot;, 15),     command=lambda x=1: self.btn_click(x)) btn2 = Button(root, text=&quot;\u041d\u043e\u0436\u043d\u0438\u0446\u044b&quot;, font=(&quot;Times New Roman&quot;, 15),     command=lambda x=2: self.btn_click(x)) btn3 = Button(root, text=&quot;\u0411\u0443\u043c\u0430\u0433\u0430&quot;, font=(&quot;Times New Roman&quot;, 15),     command=lambda x=3: self.btn_click(x)) <\/code><\/pre>\n<p>  <\/p>\n<p><b>\u0427\u0442\u043e \u0442\u0443\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442?<\/b><\/p>\n<p>  <\/p>\n<p>\u0412\u0441\u0451 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e. \u0413\u0440\u0443\u0431\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u0435\u0441\u043b\u0438 \u0438\u0433\u0440\u043e\u043a \u043d\u0430\u0436\u043c\u0435\u0442 \u043a\u0430\u043c\u0435\u043d\u044c, \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0441\u044f 1, \u0435\u0441\u043b\u0438 \u043d\u043e\u0436\u043d\u0438\u0446\u044b, \u0442\u043e 2, \u0430 \u0435\u0441\u043b\u0438 \u0431\u0443\u043c\u0430\u0433\u0430, \u0442\u043e 3, \u043f\u0440\u0438\u0447\u0435\u043c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0441\u044f, \u043d\u043e \u0438 \u0432\u044b\u0432\u0435\u0434\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c.<br \/>  \u041d\u0430 \u0441\u0447\u0435\u0442 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430. \u041e\u043d \u0441\u0432\u043e\u0439 \u0432\u044b\u0431\u043e\u0440 \u0434\u0435\u043b\u0430\u0435\u0442, \u043d\u043e \u0435\u0433\u043e \u0432\u044b\u0431\u043e\u0440 \u043d\u0438\u043a\u0443\u0434\u0430 \u043d\u0435 \u0438\u0434\u0451\u0442.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c, \u043a\u0430\u043a \u0434\u0435\u043b\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0438\u0433\u0440\u043e\u043a\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0438 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <i>Label<\/i>. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 <i>startUI<\/i> \u0442\u0430\u043a\u0438\u0435 \u0441\u0442\u0440\u043e\u0447\u043a\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">self.lbl = Label(root, text=&quot;\u041d\u0430\u0447\u0430\u043b\u043e \u0438\u0433\u0440\u044b!&quot;, bg=&quot;#FFF&quot;,      font=(&quot;Times New Roman&quot;, 21, &quot;bold&quot;)) self.lbl.place(x=120, y=25)  self.lbl2 = Label(root, justify=&quot;left&quot;,      font=(&quot;Times New Roman&quot;, 13),     text=f&quot;\u041f\u043e\u0431\u0435\u0434: {self.win}\\n\u041f\u0440\u043e\u0438\u0433\u0440\u044b\u0448\u0435\u0439:&quot;     f&quot; {self.lose}\\n\u041d\u0438\u0447\u0435\u0439: {self.drow}&quot;,     bg=&quot;#FFF&quot;) self.lbl2.place(x=5, y=5) <\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0442\u043b\u0438\u0447\u043d\u043e. \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043d\u0430\u0434\u043f\u0438\u0441\u044c, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0443\u043d\u0434\u0430 \u0438 \u043d\u0430\u0434\u043f\u0438\u0441\u044c \u0441 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u043e\u0439.<\/p>\n<p>\u0421\u0434\u0435\u043b\u0430\u0435\u043c 3 \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0430:<\/p>\n<p>  <\/p>\n<p>&nbsp;&nbsp;1. \u041f\u043e\u0440\u0430\u0436\u0435\u043d\u0438\u0439<br \/>  &nbsp;&nbsp;2. \u041f\u043e\u0431\u0435\u0434<br \/>  &nbsp;&nbsp;3. \u041d\u0438\u0447\u0435\u0439  <\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u0441\u0435 \u0432 \u0442\u043e\u0442 \u0436\u0435 <i>startUI<\/i> \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0442\u0430\u043a\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443:<\/p>\n<pre><code class=\"python\">self.win = self.drow = self.lose = 0 <\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 <i>main<\/i> \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043c\u0435\u0442\u043e\u0434 <i>btn_click<\/i>, \u0438 \u043f\u0438\u0448\u0435\u043c \u0432 \u043d\u0435\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n<pre><code class=\"python\">def btn_click(self, choise):     comp_choise = rdm.randint(1, 3)     print(choise) <\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0435\u0434\u043e\u043b\u0433\u043e \u043c\u0443\u0437\u044b\u043a\u0430 \u0438\u0433\u0440\u0430\u043b\u0430. \u0422\u0430\u043c \u0436\u0435, \u0432 <i>btn_click<\/i>, \u0443\u0434\u0430\u043b\u044f\u0435\u043c <i><\/p>\n<blockquote><p>print(choise)<\/p><\/blockquote>\n<p><\/i> \u0438 \u043f\u0438\u0448\u0435\u043c \u0432\u043e\u0442 \u044d\u0442\u0438 \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n<pre><code class=\"python\">if choise == comp_choise:     self.drow += 1     self.lbl.configure(text=&quot;\u041d\u0438\u0447\u044c\u044f&quot;) elif choise == 1 and comp_choise == 2 \\     or choise == 2 and comp_choise == 3 \\     or choise == 3 and comp_choise == 1:     self.win += 1     self.lbl.configure(text=&quot;\u041f\u043e\u0431\u0435\u0434\u0430&quot;) else:     self.lose += 1     self.lbl.configure(text=&quot;\u041f\u0440\u043e\u0438\u0433\u0440\u044b\u0448&quot;)  self.lbl2.configure(text=f&quot;\u041f\u043e\u0431\u0435\u0434: {self.win}\\n\u041f\u0440\u043e\u0438\u0433\u0440\u044b\u0448\u0435\u0439:&quot;     f&quot; {self.lose}\\n\u041d\u0438\u0447\u0435\u0439: {self.drow}&quot;)  del comp_choise <\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u0441\u0451, \u043d\u0430 \u044d\u0442\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u043e\u0441\u044c. \u0412\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043c\u043e\u0436\u043d\u043e \u0438\u0433\u0440\u0430\u0442\u044c.<\/p>\n<h3>\u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434:<\/h3>\n<p>  <\/p>\n<pre><code class=\"python\">from tkinter import * import random as rdm   class Main(Frame):     def __init__(self, root):         super(Main, self).__init__(root)         self.startUI()      def startUI(self):         btn = Button(root, text=&quot;\u041a\u0430\u043c\u0435\u043d\u044c&quot;, font=(&quot;Times New Roman&quot;, 15),                      command=lambda x=1: self.btn_click(x))         btn2 = Button(root, text=&quot;\u041d\u043e\u0436\u043d\u0438\u0446\u044b&quot;, font=(&quot;Times New Roman&quot;, 15),                       command=lambda x=2: self.btn_click(x))         btn3 = Button(root, text=&quot;\u0411\u0443\u043c\u0430\u0433\u0430&quot;, font=(&quot;Times New Roman&quot;, 15),                       command=lambda x=3: self.btn_click(x))          btn.place(x=10, y=100, width=120, height=50)         btn2.place(x=155, y=100, width=120, height=50)         btn3.place(x=300, y=100, width=120, height=50)          self.lbl = Label(root, text=&quot;\u041d\u0430\u0447\u0430\u043b\u043e \u0438\u0433\u0440\u044b!&quot;, bg=&quot;#FFF&quot;, font=(&quot;Times New Roman&quot;, 21, &quot;bold&quot;))         self.lbl.place(x=150, y=25)          self.win = self.drow = self.lose = 0          self.lbl2 = Label(root, justify=&quot;left&quot;, font=(&quot;Times New Roman&quot;, 13),                          text=f&quot;\u041f\u043e\u0431\u0435\u0434: {self.win}\\n\u041f\u0440\u043e\u0438\u0433\u0440\u044b\u0448\u0435\u0439:&quot;                               f&quot; {self.lose}\\n\u041d\u0438\u0447\u0435\u0439: {self.drow}&quot;,                          bg=&quot;#FFF&quot;)         self.lbl2.place(x=5, y=5)      def btn_click(self, choise):         comp_choise = rdm.randint(1, 3)          if choise == comp_choise:             self.drow += 1             self.lbl.configure(text=&quot;\u041d\u0438\u0447\u044c\u044f&quot;)         elif choise == 1 and comp_choise == 2 \\                 or choise == 2 and comp_choise == 3 \\                 or choise == 3 and comp_choise == 1:             self.win += 1             self.lbl.configure(text=&quot;\u041f\u043e\u0431\u0435\u0434\u0430&quot;)         else:             self.lose += 1             self.lbl.configure(text=&quot;\u041f\u0440\u043e\u0438\u0433\u0440\u044b\u0448&quot;)          self.lbl2.configure(text=f&quot;\u041f\u043e\u0431\u0435\u0434: {self.win}\\n\u041f\u0440\u043e\u0438\u0433\u0440\u044b\u0448\u0435\u0439:&quot;                               f&quot; {self.lose}\\n\u041d\u0438\u0447\u0435\u0439: {self.drow}&quot;)          del comp_choise   if __name__ == '__main__':     root = Tk()     root.geometry(&quot;430x160+200+200&quot;)     root.title(&quot;\u041a\u0430\u043c\u0435\u043d\u044c, \u043d\u043e\u0436\u043d\u0438\u0446\u044b, \u0431\u0443\u043c\u0430\u0433\u0430&quot;)     root.resizable(False, False)     root[&quot;bg&quot;] = &quot;#FFF&quot;     app = Main(root)     app.pack()     root.mainloop()  <\/code><\/pre>\n<\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d() } } }t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>      <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\/480906\/\"> https:\/\/habr.com\/ru\/post\/480906\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/480906\/\">\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432\u0441\u0435\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0443\u044e \u0438\u0433\u0440\u0443 \u043a\u0430\u043c\u0435\u043d\u044c, \u043d\u043e\u0436\u043d\u0438\u0446\u044b, \u0431\u0443\u043c\u0430\u0433\u0430. \u0412 \u044d\u0442\u043e\u043c \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u042f\u041f python \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 tkinter, \u043d\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0437\u043d\u0430\u0435\u0442\u0435 \u0447\u0442\u043e \u044d\u0442\u043e \u0442\u0430\u043a\u043e\u0435, \u0441\u043e\u0432\u0435\u0442\u0443\u044e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u0443\u044e <a href=\"https:\/\/habr.com\/ru\/post\/133337\/\">\u0441\u0442\u0430\u0442\u044c\u044e.<\/a><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/2s\/wf\/jt\/2swfjtewp3uhp0mdhprpuzjqd-0.png\" \/><\/div>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e, \u044d\u0442\u043e \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430, \u043e\u043a\u043e\u0448\u043a\u043e, \u0443 \u043c\u0435\u043d\u044f \u043e\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">from tkinter import * import random as rdm   class Main(Frame):     def __init__(self, root):         super(Main, self).__init__(root)         self.startUI()      def startUI(self):         pass   if __name__ == '__main__':     root = Tk()     root.geometry(&quot;500x500+200+200&quot;)     root.title(&quot;\u041a\u0430\u043c\u0435\u043d\u044c, \u043d\u043e\u0436\u043d\u0438\u0446\u044b, \u0431\u0443\u043c\u0430\u0433\u0430&quot;)     root.resizable(False, False)     root[&quot;bg&quot;] = &quot;#FFF&quot;     app = Main(root)     app.pack()     root.mainloop() <\/code><\/pre>\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-295965","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/295965","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=295965"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/295965\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=295965"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=295965"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=295965"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}