{"id":444385,"date":"2025-01-09T09:06:36","date_gmt":"2025-01-09T09:06:36","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=444385"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=444385","title":{"rendered":"<span>\u041a\u0430\u043a \u044f \u043f\u043e\u044d\u0442\u0430 \u043f\u043e\u0437\u0434\u0440\u0430\u0432\u043b\u044f\u043b<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041c\u043e\u0439 \u0431\u0440\u0430\u0442 \u2013 \u043f\u043e\u044d\u0442. <\/p>\n<p>\u041c\u0435\u043d\u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u043e\u0441\u0445\u0438\u0449\u0430\u043b\u043e, \u043a\u0430\u043a \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u043c\u043e\u0436\u0435\u0442 \u0432\u0437\u044f\u0442\u044c \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0441\u0442\u0440\u043e\u0447\u043a\u0438, \u0447\u0442\u043e \u0437\u0430\u0438\u0433\u0440\u0430\u044e\u0442 \u0441\u0442\u0440\u0443\u043d\u044b \u0434\u0443\u0448\u0438, \u0434\u0430 \u0435\u0449\u0451 \u0438 \u0432 \u0440\u0438\u0444\u043c\u0443!<\/p>\n<p>\u0414\u0435\u043d\u044c \u0440\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0431\u0440\u0430\u0442\u0430, \u043c\u043d\u0435 10, \u0433\u0438\u0442\u0430\u0440\u0430 \u0443 \u0433\u0440\u0443\u0434\u0438 (\u0438\u0433\u0440\u0430\u0442\u044c \u044f \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043d\u0435 \u0443\u043c\u0435\u043b), \u0435\u0433\u043e \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0434 \u0433\u043b\u0430\u0437\u0430\u043c\u0438 \u0438 \u044f \u043f\u043e\u044e \u0441 \u0443\u043b\u044b\u0431\u043a\u043e\u0439 \u0438 \u0441\u0432\u0435\u0436\u0435\u0441\u0442\u044c\u044e, \u043a\u0430\u043a \u043f\u0435\u043b \u0433\u0438\u043c\u043d \u0448\u043a\u043e\u043b\u044b \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u0435 \u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e6a\/91c\/4b7\/e6a91c4b777c20bafca89a1595d59bb3.png\" alt=\"\u0418\u0441\u043f\u043e\u043b\u043d\u044f\u044e \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u0435 \u0431\u0440\u0430\u0442\u0430 \u043d\u0430 \u0435\u0433\u043e \u0434\u0435\u043d\u044c \u0440\u043e\u0436\u0434\u0435\u043d\u0438\u044f\" title=\"\u0418\u0441\u043f\u043e\u043b\u043d\u044f\u044e \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u0435 \u0431\u0440\u0430\u0442\u0430 \u043d\u0430 \u0435\u0433\u043e \u0434\u0435\u043d\u044c \u0440\u043e\u0436\u0434\u0435\u043d\u0438\u044f\" width=\"2164\" height=\"1610\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e6a\/91c\/4b7\/e6a91c4b777c20bafca89a1595d59bb3.png\"\/><\/p>\n<div><figcaption>\u0418\u0441\u043f\u043e\u043b\u043d\u044f\u044e \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u0435 \u0431\u0440\u0430\u0442\u0430 \u043d\u0430 \u0435\u0433\u043e \u0434\u0435\u043d\u044c \u0440\u043e\u0436\u0434\u0435\u043d\u0438\u044f<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u0440\u043e\u0448\u043b\u043e 8 \u043b\u0435\u0442&#8230; \u042f \u043f\u043e\u0434\u0440\u043e\u0441, \u0432\u044b\u0440\u043e\u0441 \u0438 \u0431\u0440\u0430\u0442. \u0418 \u0432\u043e\u0442 \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0430\u0435\u0442\u0441\u044f \u0435\u0433\u043e \u0434\u0435\u043d\u044c \u0440\u043e\u0436\u0434\u0435\u043d\u0438\u044f. \u0412\u043d\u0443\u0442\u0440\u0438 \u043c\u0435\u043d\u044f \u043f\u043e\u0440\u044b\u0432, \u0432\u043d\u0443\u0442\u0440\u0438 \u043c\u0435\u043d\u044f \u0436\u0435\u043b\u0430\u043d\u0438\u0435&#8230; \u043f\u043e\u0437\u0434\u0440\u0430\u0432\u0438\u0442\u044c, \u043d\u043e \u043a\u0430\u043a-\u0442\u043e \u0441 \u0438\u0437\u044e\u043c\u0438\u043d\u043a\u043e\u0439, \u043a\u0430\u043a-\u0442\u043e&#8230; \u0441 \u0434\u0443\u0448\u043e\u0439 \u0447\u0442\u043e \u043b\u0438.<\/p>\n<p>\u042f \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044e \u0448\u043a\u043e\u043b\u0443, \u0438\u043c\u0435\u044e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043e\u043f\u044b\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Python_(programming_language)\" rel=\"noopener noreferrer nofollow\">Python<\/a>, \u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043f\u0440\u0435\u0442\u0432\u043e\u0440\u044f\u0442\u044c \u0438\u0434\u0435\u0438 \u0432 \u0436\u0438\u0437\u043d\u044c. \u0418 \u043b\u0430\u043c\u043f\u043e\u0447\u043a\u0430 \u0432 \u0433\u043e\u043b\u043e\u0432\u0435 \u0437\u0430\u0436\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u2013 \u043f\u043e\u044d\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0432\u0438\u043a\u0442\u043e\u0440\u0438\u043d\u0430!<\/p>\n<h4>\u0418\u0434\u0435\u044f <\/h4>\n<p>\u0412\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f, \u0430 \u043d\u0438\u0436\u0435 \u2013 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 (\u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438) \u0438 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 (\u0442\u043e \u0435\u0441\u0442\u044c \u2013 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f). <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0438\u0433\u0440\u043e\u043a \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443, \u0442\u043e \u0438\u0433\u0440\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f \u0438 \u0435\u043c\u0443 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0447\u0430\u0442\u044c \u0437\u0430\u043d\u043e\u0432\u043e, \u043f\u0440\u0438\u0447\u0451\u043c \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u0435 (\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u0433\u0430\u0434\u0430\u0442\u044c) \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u043e\u044d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0432\u0438\u043a\u0442\u043e\u0440\u0438\u043d\u044b<\/h2>\n<h3>\u0428\u0430\u0433 \u043f\u0435\u0440\u0432\u044b\u0439 \u2013 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435<\/h3>\n<p>\u041d\u0430\u0447\u0430\u0442\u044c \u044f \u0440\u0435\u0448\u0438\u043b \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0445\u0435\u043c\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b: <\/p>\n<ul>\n<li>\n<p>\u041a\u0430\u043a \u043e\u043d\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c<\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u043a\u0438\u0435 \u0435\u0441\u0442\u044c \u043e\u043a\u043d\u0430<\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u043a\u0438\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/b7b\/c2f\/db7\/b7bc2fdb73dadbb5486b4a282621c8cc.jpg\" alt=\"\u0421\u0445\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 &quot;\u041f\u043e\u044d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0432\u0438\u043a\u0442\u043e\u0440\u0438\u043d\u044b&quot;\" title=\"\u0421\u0445\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 &quot;\u041f\u043e\u044d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0432\u0438\u043a\u0442\u043e\u0440\u0438\u043d\u044b&quot;\" width=\"4080\" height=\"3072\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b7b\/c2f\/db7\/b7bc2fdb73dadbb5486b4a282621c8cc.jpg\" data-blurred=\"true\"\/><\/p>\n<div><figcaption>\u0421\u0445\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 &#171;\u041f\u043e\u044d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0432\u0438\u043a\u0442\u043e\u0440\u0438\u043d\u044b&#187;<\/figcaption><\/div>\n<\/figure>\n<p>\u0420\u0435\u0448\u0438\u043b, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0442\u0440\u0438 \u043e\u043a\u043d\u0430:<\/p>\n<ul>\n<li>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435, \u0433\u0434\u0435 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u043a\u043d\u043e\u043f\u043a\u0438 \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u0433\u0440\u044b, \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u043c\u0435\u043d\u044e \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u0439 \u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/p>\n<\/li>\n<li>\n<p>\u041c\u0435\u043d\u044e \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u0439, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432\u0441\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0432 \u0438\u0433\u0440\u0435 \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u0418\u0433\u0440\u043e\u0432\u043e\u0435 \u043e\u043a\u043d\u043e, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043e\u0442\u0432\u0435\u0442\u0430 \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u0435 (\u0435\u0441\u043b\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f)<\/p>\n<\/li>\n<\/ul>\n<h3>\u0412\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u0443\u043f\u0435\u043d\u044c\u043a\u0430 \u2013 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/h3>\n<p>\u041d\u0435 \u0441\u0442\u0430\u043b \u043c\u0443\u0434\u0440\u0438\u0442\u044c \u0438 \u0440\u0435\u0448\u0438\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e, \u0447\u0442\u043e \u0437\u043d\u0430\u044e \u2013 Python. \u0414\u043b\u044f \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0432\u044b\u0431\u0440\u0430\u043b \u043c\u043e\u0434\u0443\u043b\u044c <a href=\"https:\/\/ru.wikipedia.org\/wiki\/Tkinter\" rel=\"noopener noreferrer nofollow\">tkinter<\/a>.<\/p>\n<p>\u0412\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432 \u0438\u0437-\u0437\u0430 \u0432\u0435\u0440\u0441\u0438\u0439 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0440\u0435\u0448\u0438\u043b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438. \u0414\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432\u044b\u0431\u0440\u0430\u043b <a href=\"https:\/\/github.com\" rel=\"noopener noreferrer nofollow\">GitHub<\/a>.<\/p>\n<p>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<ul>\n<li>\n<p>venv \u2013 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u0434\u043b\u044f \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>.gitignore \u2013 \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0439 \u043f\u0440\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0447\u0435\u0440\u0435\u0437 <a href=\"https:\/\/git-scm.com\" rel=\"noopener noreferrer nofollow\">Git<\/a><\/p>\n<\/li>\n<li>\n<p>constants.py \u2013 \u0444\u0430\u0439\u043b \u0441 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430\u043c\u0438<\/p>\n<\/li>\n<li>\n<p>main.py \u2013 \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/p>\n<\/li>\n<li>\n<p>poetry.py \u2013 \u0444\u0430\u0439\u043b \u0441\u043e \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f\u043c\u0438<\/p>\n<\/li>\n<li>\n<p>README.md \u2013 \u0444\u0430\u0439\u043b \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442<\/p>\n<\/li>\n<li>\n<p>ui.py \u2013 \u0444\u0430\u0439\u043b \u0441 \u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b UI<\/p>\n<\/li>\n<\/ul>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/915\/bdf\/0d4\/915bdf0d42d913a4aeee4bd7fb7fb251.png\" alt=\"\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\" title=\"\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\" width=\"317\" height=\"160\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/915\/bdf\/0d4\/915bdf0d42d913a4aeee4bd7fb7fb251.png\"\/><\/p>\n<div><figcaption>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/figcaption><\/div>\n<\/figure>\n<p>\u0412 .gitignore \u0434\u043e\u0431\u0430\u0432\u0438\u043b:<\/p>\n<pre><code class=\"python\"> .idea \/venv\/<\/code><\/pre>\n<p>constants.py<\/p>\n<pre><code class=\"python\">MAIN_BUTTON_FONT = \"Arial 24\" ANSWER_BUTTON_FONT = \"Arial 20\" BLACK = \"black\" WHITE = \"white\"<\/code><\/pre>\n<p>main.py:<\/p>\n<pre><code class=\"python\">from ui import UI  if __name__ == \"__main__\":     ui = UI()     ui.start_ui()<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u0439 \u0432\u044b\u0431\u0440\u0430\u043b \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445 Python \u2013 \u0441\u043b\u043e\u0432\u0430\u0440\u044c. <br \/>\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043b\u044e\u0447\u043e\u043c \u0441\u043b\u043e\u0432\u0430\u0440\u044f, \u0430 \u0442\u0435\u043a\u0441\u0442 \u2013 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c. \u0422\u0435\u043a\u0441\u0442 \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d \u0432 \u0432\u0438\u0434\u0435 \u0441\u043f\u0438\u0441\u043a\u0430. \u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0441\u043f\u0438\u0441\u043a\u0430 \u2013 \u0441\u0442\u0440\u043e\u043a\u0438 \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f.<\/p>\n<p>poetry.py:<\/p>\n<pre><code class=\"python\">poetry_dict = {     \"\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435_\u0432\u0430\u0448\u0435\u0433\u043e_\u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f\": [         \"\u041f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f,\",         \"\u0412\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f.\",     ],     \"\u0412\u0441\u0435\u0433\u0434\u0430\": [         \"\u0412\u0441\u0435\u0433\u0434\u0430,\",         \"\u0427\u0442\u043e-\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442.\",         \"\u0412\u0437\u043b\u0451\u0442\u044b \u0438 \u043f\u0430\u0434\u0435\u043d\u0438\u044f,\",         \"\u041a\u043e\u0433\u0434\u0430-\u0442\u043e \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442.\",         \"\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0438\u0445 \u0446\u0435\u043d\u0438\u0442\u044c,\",         \"\u0423\u0447\u0438\u0442 \u043d\u0430\u0448\u0430 \u043a\u043e\u0440\u043e\u0442\u043a\u0430\u044f \u0436\u0438\u0437\u043d\u044c.\",     ],     \"Dark night\": [         \"Yeah, I guess I\u2019m alright,\",         \"Writing some notes,\",         \"To get rid of my thoughts,\",         \"The past and future all combined,\",         \"Been heavy lately on my mind,\",         \"I am sure it\u2019s temporary,\",         \"No need more worries,\",         \"The good side actually,\",         \"I will be able to tell more stories.\",     ], }<\/code><\/pre>\n<p>\u041d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0430 \u0432 \u0444\u0430\u0439\u043b\u0435 ui.py.<br \/>\u0420\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c UI \u0447\u0435\u0440\u0435\u0437 \u043a\u043b\u0430\u0441\u0441 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <strong>self<\/strong> \u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b.<\/p>\n<p>\u041f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u0438\u0441\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u044b:<\/p>\n<pre><code class=\"python\">import random import tkinter as tk from tkinter import ttk from constants import ANSWER_BUTTON_FONT, BLACK, MAIN_BUTTON_FONT, WHITE from poetry import poetry_dict<\/code><\/pre>\n<p>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"python\">class UI:     def __init__(self):         self.root = tk.Tk()         self.root.title(\"Poetry Quiz\")         self.root.configure(background=\"gray\")         self.root.geometry(\"900x600\")<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435:<\/p>\n<pre><code class=\"python\">        self.poetry_part = tk.StringVar()         self.poetry_titles = [element for element in poetry_dict.keys()]         self.poetry_showing_name = \"\"         self.poetry_showing = []          self.step = 0         self.last_step = 0         self.mistakes = 0<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0451\u043c UI-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b (\u0442\u0435\u043a\u0441\u0442, \u043a\u043d\u043e\u043f\u043a\u0438, \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a):<\/p>\n<pre><code class=\"python\">        self.poetry_label = tk.Label(             self.root, textvariable=self.poetry_part, font=\"Arial 26\"         )         self.start_label = tk.Label(self.root, text=\"Poetry Quiz\", font=\"Arial 36\")         self.start_label.pack(fill=\"both\", expand=True)         self.start_button = tk.Button(             self.root,             text=\"\u041d\u0430\u0447\u0430\u0442\u044c \u0438\u0433\u0440\u0443\",             background=WHITE,             foreground=BLACK,             highlightbackground=\"green\",             highlightthickness=2.5,             font=MAIN_BUTTON_FONT,             command=self.play_game,             justify=tk.CENTER,         )         self.start_button.pack(expand=True)          self.poetry_button = tk.Button(             self.root,             text=\"\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f\",             background=WHITE,             foreground=BLACK,             highlightbackground=\"orange\",             highlightthickness=2.5,             font=MAIN_BUTTON_FONT,             command=self.open_poetry_menu,             justify=tk.CENTER,         )         self.poetry_button.pack(expand=True)          self.exit_button = tk.Button(             self.root,             text=\"\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u0438\u0433\u0440\u0443\",             background=WHITE,             foreground=BLACK,             highlightbackground=\"red\",             highlightthickness=2.5,             font=MAIN_BUTTON_FONT,             command=self.destroy_ui,             justify=tk.CENTER,         )         self.exit_button.pack(expand=True)          self.another_poetry = tk.Button(             self.root,             background=WHITE,             text=\"\u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0435 \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u0435\",             foreground=BLACK,             highlightbackground=\"orange\",             highlightthickness=2.5,             font=MAIN_BUTTON_FONT,             command=self.change_poetry,             justify=tk.CENTER,         )          self.first_answer_button = tk.Button(             self.root,             background=WHITE,             foreground=BLACK,             highlightbackground=\"green\",             highlightthickness=2.5,             font=ANSWER_BUTTON_FONT,             justify=tk.CENTER,         )         self.first_answer_button.bind(\"&lt;Button-1&gt;\", self.next_pick)          self.second_answer_button = tk.Button(             self.root,             background=WHITE,             foreground=BLACK,             highlightbackground=\"green\",             highlightthickness=2.5,             font=ANSWER_BUTTON_FONT,             justify=tk.CENTER,         )         self.second_answer_button.bind(\"&lt;Button-1&gt;\", self.next_pick)          self.third_answer_button = tk.Button(             self.root,             background=WHITE,             foreground=BLACK,             highlightbackground=\"green\",             highlightthickness=2.5,             font=ANSWER_BUTTON_FONT,             justify=tk.CENTER,         )         self.third_answer_button.bind(\"&lt;Button-1&gt;\", self.next_pick)          self.poetry_choices = ttk.Combobox(             self.root, values=self.poetry_titles, font=\"Arial 18\"         )         self.poetry_choices.set(\"\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u0435\")         self.poetry_choices.bind(\"&lt;&lt;ComboboxSelected&gt;&gt;\", self.open_poetry)          self.go_back_button = tk.Button(             self.root,             text=\"\u041d\u0430\u0437\u0430\u0434\",             background=WHITE,             foreground=BLACK,             highlightbackground=\"red\",             highlightthickness=2.5,             font=MAIN_BUTTON_FONT,             command=self.go_back_to_menu,             justify=tk.CENTER,         )<\/code><\/pre>\n<p>\u041c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u044f UI (\u043f\u0440\u0438 \u0432\u044b\u0445\u043e\u0434\u0435 \u0438\u0437 \u0438\u0433\u0440\u044b):<\/p>\n<pre><code class=\"python\">    def start_ui(self) -&gt; None:         self.root.mainloop()      def destroy_ui(self) -&gt; None:         self.root.destroy()<\/code><\/pre>\n<p>\u0420\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u0441\u043a\u0440\u044b\u0442\u0438\u0435 UI-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432:<\/p>\n<pre><code class=\"python\">    @staticmethod     def place_elements(*elements) -&gt; None:         for element in elements:             element.pack(side=\"top\", expand=2)      @staticmethod     def hide_elements(*elements) -&gt; None:         for element in elements:             element.pack_forget()<\/code><\/pre>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0442\u0435\u043a\u0441\u0442\u0430 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0438 \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u043e\u0442\u0432\u0435\u0442\u0430:<\/p>\n<pre><code class=\"python\">    def set_all_buttons(         self, poetry_showing_name: str, poetry_showing: list, step: int     ) -&gt; None:         self.poetry_part.set(poetry_showing[step])                first_poetry = random.choice(list(poetry_dict.keys()))         while first_poetry == poetry_showing_name:             first_poetry = random.choice(list(poetry_dict.keys()))          second_poetry = random.choice(list(poetry_dict.keys()))         while second_poetry in [first_poetry, poetry_showing_name]:             second_poetry = random.choice(list(poetry_dict.keys()))          first_poetry = random.choice(poetry_dict[first_poetry])         second_poetry = random.choice(poetry_dict[second_poetry])         right_poetry = poetry_showing[step + 1]         text = [first_poetry, second_poetry, right_poetry]          for button in (             self.first_answer_button,             self.second_answer_button,             self.third_answer_button,         ):             text_for_button = random.choice(text)             button.configure(text=text_for_button)             del text[text.index(text_for_button)]<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a \u0438\u0433\u0440\u044b (\u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 &#171;\u041d\u0430\u0447\u0430\u0442\u044c \u0438\u0433\u0440\u0443&#187;):<\/p>\n<pre><code class=\"python\">    def play_game(self) -&gt; None:         self.hide_elements(             self.start_label,             self.start_button,             self.exit_button,             self.poetry_button,         )          self.poetry_showing_name = random.choice(list(poetry_dict.keys()))         self.poetry_showing = poetry_dict[self.poetry_showing_name]         self.last_step = len(self.poetry_showing)         self.poetry_part.set(self.poetry_showing[self.step])                  self.poetry_label.configure(font=\"Arial 26\")         self.poetry_label.pack(fill=\"both\", expand=True)         self.set_all_buttons(             poetry_showing_name=self.poetry_showing_name,             poetry_showing=self.poetry_showing,             step=self.step,         )                  self.place_elements(             self.first_answer_button,             self.second_answer_button,             self.third_answer_button,             self.another_poetry,             self.go_back_button,         )<\/code><\/pre>\n<p>\u0417\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u0438\u0433\u0440\u044b (\u043f\u0440\u0438 \u043f\u043e\u0431\u0435\u0434\u0435 \u0438\u043b\u0438 \u043f\u043e\u0440\u0430\u0436\u0435\u043d\u0438\u0438):<\/p>\n<pre><code class=\"python\">    def finish_game(self, lost: bool = False) -&gt; None:         self.hide_elements(             self.first_answer_button,             self.second_answer_button,             self.third_answer_button,         )                self.another_poetry.configure(text=\"\u0421\u044b\u0433\u0440\u0430\u0442\u044c \u0437\u0430\u043d\u043e\u0432\u043e\")                  if lost:             self.poetry_part.set(f\"\u0423\u043f\u0441!\\n\\n\u0412\u044b \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0443.\\n\\n\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0437\u0430\u043d\u043e\u0432\u043e.\")         else:             self.poetry_part.set(\"\u041f\u043e\u0437\u0434\u0440\u0430\u0432\u043b\u044f\u044e!\\n\\n\u0412\u044b \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0443\u0433\u0430\u0434\u0430\u043b\u0438 \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u0435!\")<\/code><\/pre>\n<p>\u041e\u0442\u043a\u0440\u044b\u0442\u0438\u0435 \u043e\u043a\u043d\u0430 &#171;\u041c\u0435\u043d\u044e \u0441\u043e \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f\u043c\u0438&#187;:<\/p>\n<pre><code class=\"python\">    def open_poetry_menu(self) -&gt; None:         self.hide_elements(             self.start_label,             self.start_button,             self.exit_button,             self.poetry_button,         )          self.poetry_choices.pack(side=\"top\", expand=2)         self.go_back_button.pack(side=\"bottom\", expand=2)<\/code><\/pre>\n<p>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0442\u0435\u043a\u0441\u0442\u0430 \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f (\u0432 \u043c\u0435\u043d\u044e \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u0439):<\/p>\n<pre><code class=\"python\">    def build_poetry(self, poetry_rows: list) -&gt; str:         poetry = self.poetry_choices.get().upper() + \"\\n\\n\"         return poetry + \"\\n\".join(poetry_rows)<\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434 \u0442\u0435\u043a\u0441\u0442\u0430 \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u0432\u044b\u0431\u043e\u0440\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0441\u043f\u0438\u0441\u043a\u0435 (Combo box):<\/p>\n<pre><code class=\"python\">    def open_poetry(self, _: tk.Event) -&gt; None:         poetry_rows = poetry_dict[self.poetry_choices.get()]         poetry = self.build_poetry(poetry_rows)         self.poetry_part.set(poetry)         self.poetry_label.configure(font=\"Arial 16\")         self.poetry_label.pack(fill=\"both\", expand=True)<\/code><\/pre>\n<p>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043e\u043a\u043d\u043e (\u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 &#171;\u041d\u0430\u0437\u0430\u0434&#187;):<\/p>\n<pre><code class=\"python\">    def go_back_to_menu(self) -&gt; None:         self.hide_elements(             self.poetry_label,             self.poetry_choices,             self.first_answer_button,             self.second_answer_button,             self.third_answer_button,             self.another_poetry,             self.go_back_button,         )          self.start_label.pack(fill=\"both\", expand=True)         self.place_elements(self.start_button, self.poetry_button, self.exit_button)<\/code><\/pre>\n<p>\u041a\u043d\u043e\u043f\u043a\u0430 &#171;\u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0435 \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u0435&#187; \u0438 &#171;\u0421\u044b\u0433\u0440\u0430\u0442\u044c \u0437\u0430\u043d\u043e\u0432\u043e&#187;:<\/p>\n<pre><code class=\"python\">    def change_poetry(self) -&gt; None:         if self.another_poetry[\"text\"] == \"\u0421\u044b\u0433\u0440\u0430\u0442\u044c \u0437\u0430\u043d\u043e\u0432\u043e\":             self.hide_elements(                 self.poetry_label,                 self.first_answer_button,                 self.second_answer_button,                 self.third_answer_button,                 self.another_poetry,                 self.go_back_button,             )              self.another_poetry.configure(text=\"\u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0435 \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u0435\")             self.poetry_label.configure(font=\"Arial 26\")             self.poetry_label.pack(fill=\"both\", expand=True)             self.first_answer_button.pack(side=\"top\", expand=2)             self.second_answer_button.pack(side=\"top\", expand=2)             self.third_answer_button.pack(side=\"top\", expand=2)             self.another_poetry.configure(text=\"\u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0435 \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u0435\")             self.another_poetry.pack(side=\"top\", expand=2)             self.go_back_button.pack(side=\"top\", expand=2)          self.poetry_showing_name = random.choice(list(poetry_dict.keys()))         self.poetry_showing = poetry_dict[self.poetry_showing_name]         self.step = 0         self.set_all_buttons(             self.poetry_showing_name,             self.poetry_showing,             self.step,         )          self.last_step = len(self.poetry_showing)<\/code><\/pre>\n<p>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u0430 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u043e\u0442\u0432\u0435\u0442\u0430:<\/p>\n<pre><code class=\"python\">    def get_clicked_button_text(self, button_id: str) -&gt; str:         return {             \"!button5\": self.first_answer_button[\"text\"],             \"!button6\": self.second_answer_button[\"text\"],             \"!button7\": self.third_answer_button[\"text\"],         }[button_id]<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043e\u0442\u0432\u0435\u0442\u0430:<\/p>\n<pre><code class=\"python\">    def is_correct_answer(self, button_id: str, step: int) -&gt; bool:         right_answer = self.poetry_showing[step]         picked_answer = self.get_clicked_button_text(button_id)         if right_answer != picked_answer:             self.finish_game(True)             return False         return True<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0448\u0430\u0433:<\/p>\n<pre><code class=\"python\">    def next_pick(self, event: tk.Event) -&gt; None:         if self.step &lt; (self.last_step - 2):             self.step += 1             if self.is_correct_answer(event.widget._name, self.step):                 self.set_all_buttons(                     poetry_showing_name=self.poetry_showing_name,                     poetry_showing=self.poetry_showing,                     step=self.step,                 )             return          self.finish_game()<\/code><\/pre>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u0442\u0430\u043a\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dd0\/475\/63b\/dd047563bf06f5a8343f95bce833ce43.gif\" alt=\"\u0418\u0433\u0440\u0430 \u0432 &quot;Poetry Quiz&quot;\" title=\"\u0418\u0433\u0440\u0430 \u0432 &quot;Poetry Quiz&quot;\" width=\"800\" height=\"450\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dd0\/475\/63b\/dd047563bf06f5a8343f95bce833ce43.gif\"\/><\/p>\n<div><figcaption>\u0418\u0433\u0440\u0430 \u0432 &#171;Poetry Quiz&#187;<\/figcaption><\/div>\n<\/figure>\n<h3>\u041f\u043e\u0434\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0438\u0442\u043e\u0433\u043e\u0432<\/h3>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0432\u0441\u0435\u0433\u0434\u0430 \u0435\u0441\u0442\u044c \u043a\u0443\u0434\u0430 \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u044c\u0441\u044f. <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0435\u0449\u0451:<\/p>\n<ul>\n<li>\n<p>\u0421\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043b\u0430\u0432\u043d\u0435\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043c\u0435\u0436\u0434\u0443 \u043e\u043a\u043d\u0430\u043c\u0438<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043a\u0440\u044b\u0442\u044c \u043a\u043e\u0434 \u0442\u0435\u0441\u0442\u0430\u043c\u0438<\/p>\n<\/li>\n<li>\n<p>\u0418 \u043c\u043d\u043e\u0433\u043e \u0447\u0435\u0433\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e<\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u043c\u0435\u043d\u044f \u0432\u0441\u0451 \u0443\u0441\u0442\u0440\u043e\u0438\u043b\u043e \u0438 \u044f \u0440\u0430\u0434 \u0431\u044b\u043b \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u043f\u043e\u0434\u0430\u0440\u043e\u043a.<\/p>\n<hr\/>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044e \u0437\u0430 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u0435 \u0438 \u0436\u0435\u043b\u0430\u044e \u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e \u0434\u043d\u044f!  =)<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/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\/articles\/869768\/\"> https:\/\/habr.com\/ru\/articles\/869768\/<\/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 article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041c\u043e\u0439 \u0431\u0440\u0430\u0442 \u2013 \u043f\u043e\u044d\u0442. <\/p>\n<p>\u041c\u0435\u043d\u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u043e\u0441\u0445\u0438\u0449\u0430\u043b\u043e, \u043a\u0430\u043a \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u043c\u043e\u0436\u0435\u0442 \u0432\u0437\u044f\u0442\u044c \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0441\u0442\u0440\u043e\u0447\u043a\u0438, \u0447\u0442\u043e \u0437\u0430\u0438\u0433\u0440\u0430\u044e\u0442 \u0441\u0442\u0440\u0443\u043d\u044b \u0434\u0443\u0448\u0438, \u0434\u0430 \u0435\u0449\u0451 \u0438 \u0432 \u0440\u0438\u0444\u043c\u0443!<\/p>\n<p>\u0414\u0435\u043d\u044c \u0440\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0431\u0440\u0430\u0442\u0430, \u043c\u043d\u0435 10, \u0433\u0438\u0442\u0430\u0440\u0430 \u0443 \u0433\u0440\u0443\u0434\u0438 (\u0438\u0433\u0440\u0430\u0442\u044c \u044f \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043d\u0435 \u0443\u043c\u0435\u043b), \u0435\u0433\u043e \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0434 \u0433\u043b\u0430\u0437\u0430\u043c\u0438 \u0438 \u044f \u043f\u043e\u044e \u0441 \u0443\u043b\u044b\u0431\u043a\u043e\u0439 \u0438 \u0441\u0432\u0435\u0436\u0435\u0441\u0442\u044c\u044e, \u043a\u0430\u043a \u043f\u0435\u043b \u0433\u0438\u043c\u043d \u0448\u043a\u043e\u043b\u044b \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u0435 \u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f. <\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0418\u0441\u043f\u043e\u043b\u043d\u044f\u044e \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u0435 \u0431\u0440\u0430\u0442\u0430 \u043d\u0430 \u0435\u0433\u043e \u0434\u0435\u043d\u044c \u0440\u043e\u0436\u0434\u0435\u043d\u0438\u044f<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u0440\u043e\u0448\u043b\u043e 8 \u043b\u0435\u0442&#8230; \u042f \u043f\u043e\u0434\u0440\u043e\u0441, \u0432\u044b\u0440\u043e\u0441 \u0438 \u0431\u0440\u0430\u0442. \u0418 \u0432\u043e\u0442 \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0430\u0435\u0442\u0441\u044f \u0435\u0433\u043e \u0434\u0435\u043d\u044c \u0440\u043e\u0436\u0434\u0435\u043d\u0438\u044f. \u0412\u043d\u0443\u0442\u0440\u0438 \u043c\u0435\u043d\u044f \u043f\u043e\u0440\u044b\u0432, \u0432\u043d\u0443\u0442\u0440\u0438 \u043c\u0435\u043d\u044f \u0436\u0435\u043b\u0430\u043d\u0438\u0435&#8230; \u043f\u043e\u0437\u0434\u0440\u0430\u0432\u0438\u0442\u044c, \u043d\u043e \u043a\u0430\u043a-\u0442\u043e \u0441 \u0438\u0437\u044e\u043c\u0438\u043d\u043a\u043e\u0439, \u043a\u0430\u043a-\u0442\u043e&#8230; \u0441 \u0434\u0443\u0448\u043e\u0439 \u0447\u0442\u043e \u043b\u0438.<\/p>\n<p>\u042f \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044e \u0448\u043a\u043e\u043b\u0443, \u0438\u043c\u0435\u044e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043e\u043f\u044b\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Python_(programming_language)\" rel=\"noopener noreferrer nofollow\">Python<\/a>, \u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043f\u0440\u0435\u0442\u0432\u043e\u0440\u044f\u0442\u044c \u0438\u0434\u0435\u0438 \u0432 \u0436\u0438\u0437\u043d\u044c. \u0418 \u043b\u0430\u043c\u043f\u043e\u0447\u043a\u0430 \u0432 \u0433\u043e\u043b\u043e\u0432\u0435 \u0437\u0430\u0436\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u2013 \u043f\u043e\u044d\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0432\u0438\u043a\u0442\u043e\u0440\u0438\u043d\u0430!<\/p>\n<h4>\u0418\u0434\u0435\u044f <\/h4>\n<p>\u0412\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f, \u0430 \u043d\u0438\u0436\u0435 \u2013 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 (\u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438) \u0438 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 (\u0442\u043e \u0435\u0441\u0442\u044c \u2013 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f). <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0438\u0433\u0440\u043e\u043a \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443, \u0442\u043e \u0438\u0433\u0440\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f \u0438 \u0435\u043c\u0443 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0447\u0430\u0442\u044c \u0437\u0430\u043d\u043e\u0432\u043e, \u043f\u0440\u0438\u0447\u0451\u043c \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u0435 (\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u0433\u0430\u0434\u0430\u0442\u044c) \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u043e\u044d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0432\u0438\u043a\u0442\u043e\u0440\u0438\u043d\u044b<\/h2>\n<h3>\u0428\u0430\u0433 \u043f\u0435\u0440\u0432\u044b\u0439 \u2013 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435<\/h3>\n<p>\u041d\u0430\u0447\u0430\u0442\u044c \u044f \u0440\u0435\u0448\u0438\u043b \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0445\u0435\u043c\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b: <\/p>\n<ul>\n<li>\n<p>\u041a\u0430\u043a \u043e\u043d\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c<\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u043a\u0438\u0435 \u0435\u0441\u0442\u044c \u043e\u043a\u043d\u0430<\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u043a\u0438\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\">\n<div><figcaption>\u0421\u0445\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 &#171;\u041f\u043e\u044d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0432\u0438\u043a\u0442\u043e\u0440\u0438\u043d\u044b&#187;<\/figcaption><\/div>\n<\/figure>\n<p>\u0420\u0435\u0448\u0438\u043b, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0442\u0440\u0438 \u043e\u043a\u043d\u0430:<\/p>\n<ul>\n<li>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435, \u0433\u0434\u0435 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u043a\u043d\u043e\u043f\u043a\u0438 \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u0433\u0440\u044b, \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u043c\u0435\u043d\u044e \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u0439 \u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/p>\n<\/li>\n<li>\n<p>\u041c\u0435\u043d\u044e \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u0439, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432\u0441\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0432 \u0438\u0433\u0440\u0435 \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u0418\u0433\u0440\u043e\u0432\u043e\u0435 \u043e\u043a\u043d\u043e, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043e\u0442\u0432\u0435\u0442\u0430 \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u0435 (\u0435\u0441\u043b\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f)<\/p>\n<\/li>\n<\/ul>\n<h3>\u0412\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u0443\u043f\u0435\u043d\u044c\u043a\u0430 \u2013 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/h3>\n<p>\u041d\u0435 \u0441\u0442\u0430\u043b \u043c\u0443\u0434\u0440\u0438\u0442\u044c \u0438 \u0440\u0435\u0448\u0438\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e, \u0447\u0442\u043e \u0437\u043d\u0430\u044e \u2013 Python. \u0414\u043b\u044f \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0432\u044b\u0431\u0440\u0430\u043b \u043c\u043e\u0434\u0443\u043b\u044c <a href=\"https:\/\/ru.wikipedia.org\/wiki\/Tkinter\" rel=\"noopener noreferrer nofollow\">tkinter<\/a>.<\/p>\n<p>\u0412\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432 \u0438\u0437-\u0437\u0430 \u0432\u0435\u0440\u0441\u0438\u0439 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0440\u0435\u0448\u0438\u043b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438. \u0414\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432\u044b\u0431\u0440\u0430\u043b <a href=\"https:\/\/github.com\" rel=\"noopener noreferrer nofollow\">GitHub<\/a>.<\/p>\n<p>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<ul>\n<li>\n<p>venv \u2013 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u0434\u043b\u044f \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>.gitignore \u2013 \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0439 \u043f\u0440\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0447\u0435\u0440\u0435\u0437 <a href=\"https:\/\/git-scm.com\" rel=\"noopener noreferrer nofollow\">Git<\/a><\/p>\n<\/li>\n<li>\n<p>constants.py \u2013 \u0444\u0430\u0439\u043b \u0441 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430\u043c\u0438<\/p>\n<\/li>\n<li>\n<p>main.py \u2013 \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/p>\n<\/li>\n<li>\n<p>poetry.py \u2013 \u0444\u0430\u0439\u043b \u0441\u043e \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f\u043c\u0438<\/p>\n<\/li>\n<li>\n<p>README.md \u2013 \u0444\u0430\u0439\u043b \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442<\/p>\n<\/li>\n<li>\n<p>ui.py \u2013 \u0444\u0430\u0439\u043b \u0441 \u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b UI<\/p>\n<\/li>\n<\/ul>\n<figure class=\"\">\n<div><figcaption>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/figcaption><\/div>\n<\/figure>\n<p>\u0412 .gitignore \u0434\u043e\u0431\u0430\u0432\u0438\u043b:<\/p>\n<pre><code class=\"python\"> .idea \/venv\/<\/code><\/pre>\n<p>constants.py<\/p>\n<pre><code class=\"python\">MAIN_BUTTON_FONT = \"Arial 24\" ANSWER_BUTTON_FONT = \"Arial 20\" BLACK = \"black\" WHITE = \"white\"<\/code><\/pre>\n<p>main.py:<\/p>\n<pre><code class=\"python\">from ui import UI  if __name__ == \"__main__\":     ui = UI()     ui.start_ui()<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u0439 \u0432\u044b\u0431\u0440\u0430\u043b \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445 Python \u2013 \u0441\u043b\u043e\u0432\u0430\u0440\u044c. <br \/>\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043b\u044e\u0447\u043e\u043c \u0441\u043b\u043e\u0432\u0430\u0440\u044f, \u0430 \u0442\u0435\u043a\u0441\u0442 \u2013 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c. \u0422\u0435\u043a\u0441\u0442 \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d \u0432 \u0432\u0438\u0434\u0435 \u0441\u043f\u0438\u0441\u043a\u0430. \u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0441\u043f\u0438\u0441\u043a\u0430 \u2013 \u0441\u0442\u0440\u043e\u043a\u0438 \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f.<\/p>\n<p>poetry.py:<\/p>\n<pre><code class=\"python\">poetry_dict = {     \"\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435_\u0432\u0430\u0448\u0435\u0433\u043e_\u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f\": [         \"\u041f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f,\",         \"\u0412\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f.\",     ],     \"\u0412\u0441\u0435\u0433\u0434\u0430\": [         \"\u0412\u0441\u0435\u0433\u0434\u0430,\",         \"\u0427\u0442\u043e-\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442.\",         \"\u0412\u0437\u043b\u0451\u0442\u044b \u0438 \u043f\u0430\u0434\u0435\u043d\u0438\u044f,\",         \"\u041a\u043e\u0433\u0434\u0430-\u0442\u043e \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442.\",         \"\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0438\u0445 \u0446\u0435\u043d\u0438\u0442\u044c,\",         \"\u0423\u0447\u0438\u0442 \u043d\u0430\u0448\u0430 \u043a\u043e\u0440\u043e\u0442\u043a\u0430\u044f \u0436\u0438\u0437\u043d\u044c.\",     ],     \"Dark night\": [         \"Yeah, I guess I\u2019m alright,\",         \"Writing some notes,\",         \"To get rid of my thoughts,\",         \"The past and future all combined,\",         \"Been heavy lately on my mind,\",         \"I am sure it\u2019s temporary,\",         \"No need more worries,\",         \"The good side actually,\",         \"I will be able to tell more stories.\",     ], }<\/code><\/pre>\n<p>\u041d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0430 \u0432 \u0444\u0430\u0439\u043b\u0435 ui.py.<br \/>\u0420\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c UI \u0447\u0435\u0440\u0435\u0437 \u043a\u043b\u0430\u0441\u0441 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <strong>self<\/strong> \u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b.<\/p>\n<p>\u041f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u0438\u0441\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u044b:<\/p>\n<pre><code class=\"python\">import random import tkinter as tk from tkinter import ttk from constants import ANSWER_BUTTON_FONT, BLACK, MAIN_BUTTON_FONT, WHITE from poetry import poetry_dict<\/code><\/pre>\n<p>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"python\">class UI:     def __init__(self):         self.root = tk.Tk()         self.root.title(\"Poetry Quiz\")         self.root.configure(background=\"gray\")         self.root.geometry(\"900x600\")<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435:<\/p>\n<pre><code class=\"python\">        self.poetry_part = tk.StringVar()         self.poetry_titles = [element for element in poetry_dict.keys()]         self.poetry_showing_name = \"\"         self.poetry_showing = []          self.step = 0         self.last_step = 0         self.mistakes = 0<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0451\u043c UI-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b (\u0442\u0435\u043a\u0441\u0442, \u043a\u043d\u043e\u043f\u043a\u0438, \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a):<\/p>\n<pre><code class=\"python\">        self.poetry_label = tk.Label(             self.root, textvariable=self.poetry_part, font=\"Arial 26\"         )         self.start_label = tk.Label(self.root, text=\"Poetry Quiz\", font=\"Arial 36\")         self.start_label.pack(fill=\"both\", expand=True)         self.start_button = tk.Button(             self.root,             text=\"\u041d\u0430\u0447\u0430\u0442\u044c \u0438\u0433\u0440\u0443\",             background=WHITE,             foreground=BLACK,             highlightbackground=\"green\",             highlightthickness=2.5,             font=MAIN_BUTTON_FONT,             command=self.play_game,             justify=tk.CENTER,         )         self.start_button.pack(expand=True)          self.poetry_button = tk.Button(             self.root,             text=\"\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f\",             background=WHITE,             foreground=BLACK,             highlightbackground=\"orange\",             highlightthickness=2.5,             font=MAIN_BUTTON_FONT,             command=self.open_poetry_menu,             justify=tk.CENTER,         )         self.poetry_button.pack(expand=True)          self.exit_button = tk.Button(             self.root,             text=\"\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u0438\u0433\u0440\u0443\",             background=WHITE,             foreground=BLACK,             highlightbackground=\"red\",             highlightthickness=2.5,             font=MAIN_BUTTON_FONT,             command=self.destroy_ui,             justify=tk.CENTER,         )         self.exit_button.pack(expand=True)          self.another_poetry = tk.Button(             self.root,             background=WHITE,             text=\"\u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0435 \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u0435\",             foreground=BLACK,             highlightbackground=\"orange\",             highlightthickness=2.5,             font=MAIN_BUTTON_FONT,             command=self.change_poetry,             justify=tk.CENTER,         )          self.first_answer_button = tk.Button(             self.root,             background=WHITE,             foreground=BLACK,             highlightbackground=\"green\",             highlightthickness=2.5,             font=ANSWER_BUTTON_FONT,             justify=tk.CENTER,         )         self.first_answer_button.bind(\"&lt;Button-1&gt;\", self.next_pick)          self.second_answer_button = tk.Button(             self.root,             background=WHITE,             foreground=BLACK,             highlightbackground=\"green\",             highlightthickness=2.5,             font=ANSWER_BUTTON_FONT,             justify=tk.CENTER,         )         self.second_answer_button.bind(\"&lt;Button-1&gt;\", self.next_pick)          self.third_answer_button = tk.Button(             self.root,             background=WHITE,             foreground=BLACK,             highlightbackground=\"green\",             highlightthickness=2.5,             font=ANSWER_BUTTON_FONT,             justify=tk.CENTER,         )         self.third_answer_button.bind(\"&lt;Button-1&gt;\", self.next_pick)          self.poetry_choices = ttk.Combobox(             self.root, values=self.poetry_titles, font=\"Arial 18\"         )         self.poetry_choices.set(\"\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0441\u0442\u0438\u0445\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u0435\")         self.poetry_choices.bind(\"&lt;&lt;ComboboxSelected&gt;&gt;\", self.open_poetry)          self.go_back_button = tk.Button(             self.root,             text=\"\u041d\u0430\u0437\u0430\u0434\",             background=WHITE,             foreground=BLACK,             highlightbackground=\"red\",             highlightthickness=2.5,             font=MAIN_BUTTON_FONT,             command=self.go_back_to_menu,             justify=tk.CENTER,         )<\/code><\/pre>\n<p>\u041c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u044f UI (\u043f\u0440\u0438 \u0432\u044b\u0445\u043e\u0434\u0435 \u0438\u0437 \u0438\u0433\u0440\u044b):<\/p>\n<pre><code class=\"python\">    def start_ui(self) -&gt; None:         self.root.mainloop()      def destroy_ui(self) -&gt; None:         self.root.destroy()<\/code><\/pre>\n<p>\u0420\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u0441\u043a\u0440\u044b\u0442\u0438\u0435 UI-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432:<\/p>\n<pre><code class=\"python\">    @staticmethod     def place_elements(*elements) -&gt; None:         for element in elements:             element.pack(side=\"top\", expand=2)      @staticmethod     def hide_elements(*elements) -&gt; None:         for element in elements:             element.pack_forget()<\/code><\/pre>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0442\u0435\u043a\u0441\u0442\u0430 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0438 \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u043e\u0442\u0432\u0435\u0442\u0430:<\/p>\n<pre><code class=\"python\">    def set_all_buttons(         self, poetry_showing_name: str, poetry_showing: list, step: int     ) -&gt; None:         self.poetry_part.set(poetry_showing[step])                first_poetry = random.choice(list(poetry_dict.keys()))         while first_poetry == poetry_showing_name:             first_poetry = random.choice(list(poetry_dict.keys()))          second_poetry = random.choice(list(poetry_dict.keys()))         while second_poetry in [first_poetry, poetry_showing_name]:             second_poetry = random.choice(list(poetry_dict.keys()))          first_poetry = random.choice(poetry_dict[first_poetry])         second_poetry = random.choice(poetry_dict[second_poetry])         right_poetry = poetry_showing[step + 1]         text = [first_poetry, second_poetry, right_poetry]          for button in (             self.first_answer_button,             self.second_answer_button,             self.third_answer_button,         ):             text_for_button = random.choice(text)             button.configure(text=text_for_button)             del text[text.index(text_for_button)]<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a \u0438\u0433\u0440\u044b (\u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 &#171;\u041d\u0430\u0447\u0430\u0442\u044c \u0438\u0433\u0440\u0443&#187;):<\/p>\n<pre><code class=\"python\">    def play_game(self) -&gt; None:         self.hide_elements(             self.start_label,             self.start_button,             self.exit_button,             self.poetry_button,         )          self.poetry_showing_name = random.choice(list(poetry_dict.keys()))         self.poetry_showing = poetry_dict[self.poetry_showing_name]         self.last_step = len(self.poetry_showing)         self.poetry_part.set(self.poetry_showing[self.step])                  self.poetry_label.configure(font=\"Arial 26\")<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-444385","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/444385","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=444385"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/444385\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=444385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=444385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=444385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}