{"id":468128,"date":"2025-07-22T09:09:31","date_gmt":"2025-07-22T09:09:31","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=468128"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=468128","title":{"rendered":"<span>\u041e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u0432\u043e\u0434\u0430-\u0432\u044b\u0432\u043e\u0434\u0430 \u0432 Python<\/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>\u0412\u0441\u0435 \u043c\u044b \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0446\u0435\u043b\u0435\u0439. \u0411\u0430\u043d\u043a\u043e\u0432\u0441\u043a\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441 \u0434\u0435\u043d\u0435\u0436\u043d\u044b\u043c\u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438, \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440\u044b \u0434\u043b\u044f \u043e\u0431\u0449\u0435\u043d\u0438\u044f. \u041e\u043d\u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u0432\u043d\u0443\u0442\u0440\u044c \u0441\u0435\u0431\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043e\u0442 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u043e\u0442\u0432\u0435\u0442. \u0411\u0430\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043e\u0442\u0432\u0435\u0442, \u043d\u043e \u044d\u0442\u043e \u0442\u0430\u043a \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u0437\u0433\u043b\u044f\u0434\u0430. \u042d\u0442\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f Input Output \u0438 \u043e\u043d\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u043e\u0439 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0435\u0439 \u0432 \u0441\u0435\u0442\u0438. \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u043e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442.<\/p>\n<h2>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435<\/h2>\n<p><strong>\u041e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u0432\u043e\u0434\u0430-\u0432\u044b\u0432\u043e\u0434\u0430 (I\/O) <\/strong> &#8212; \u044d\u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b \u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435\u043c \u0438\u043b\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u043d\u0438 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430\u043c\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439, \u0441\u0435\u0442\u044c\u044e, \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445, \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u0438 \u0442.\u0434.). \u0412 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e I\/O \u043e\u043d\u0438 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e.<\/p>\n<p>\u0412 <strong>\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0435\u043c\/\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u043c<\/strong> \u0440\u0435\u0436\u0438\u043c\u0435 \u043e\u043d\u0438 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0432 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0438 \u043e\u0442\u0432\u0435\u0442\u0430 \u043e\u0442 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438\u043b\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430.<\/p>\n<p>\u0412 <strong>\u043d\u0435\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0435\u043c\/\u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u043c<\/strong> \u0440\u0435\u0436\u0438\u043c\u0435 \u043e\u043d\u0438 \u043d\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0432 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0438 \u043e\u0442\u0432\u0435\u0442\u0430 \u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442\u0441\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \u043d\u043e\u0432\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/p>\n<h2>\u041a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f IO<\/h2>\n<p>\u0413\u0440\u0443\u0431\u043e \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0433\u0440\u0443\u043f\u043f, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043c\u043d\u043e\u044e \u043d\u0435 \u0431\u044b\u043b\u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043e:<\/p>\n<ul>\n<li>\n<p><strong>File IO<\/strong> &#8212; \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430\u043c\u0438 \u043d\u0430 \u0434\u0438\u0441\u043a\u0435 \u0447\u0435\u0440\u0435\u0437 \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443;<\/p>\n<\/li>\n<li>\n<p><strong>Device IO<\/strong> &#8212; \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432: \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u044b, \u043c\u044b\u0448\u0438, \u0434\u0438\u0441\u043a\u0438, &#8230;;<\/p>\n<\/li>\n<li>\n<p><strong>Console IO<\/strong> &#8212; \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0432\u0432\u043e\u0434\u043e\u043c\/\u0432\u044b\u0432\u043e\u0434\u043e\u043c \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435;<\/p>\n<\/li>\n<li>\n<p><strong>Network IO<\/strong> &#8212; \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u043e \u0441\u0435\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u0441\u043e\u043a\u0435\u0442\u044b;<\/p>\n<\/li>\n<li>\n<p><strong>Inter-Process IO<\/strong> &#8212; \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438 \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430;<\/p>\n<\/li>\n<\/ul>\n<h2>\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b IO<\/h2>\n<p>\u0412 Python \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c IO. \u041a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u043d\u0438\u0445 \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f. \u041f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u0432\u0441\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e IO \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c, \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c \u043f\u0440\u043e \u0441\u0430\u043c\u044b\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0438 \u0447\u0443\u0442\u044c-\u0447\u0443\u0442\u044c \u0437\u0430\u0442\u0440\u043e\u043d\u0435\u043c Linux \u0443\u0442\u0438\u043b\u0438\u0442\u044b.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"151\" width=\"151\">\n<p align=\"center\">\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442<\/p>\n<\/td>\n<td data-colwidth=\"127\" width=\"127\">\n<p align=\"center\">\u041f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b<\/p>\n<\/td>\n<td data-colwidth=\"121\" width=\"121\">\n<p align=\"center\">\u0422\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u043d\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b<\/p>\n<\/td>\n<td data-colwidth=\"128\" width=\"128\">\n<p align=\"center\">\u0422\u0438\u043f <\/p>\n<\/td>\n<td>\n<p align=\"center\">\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"151\" width=\"151\">\n<p align=\"left\"><a href=\"https:\/\/requests.readthedocs.io\/en\/latest\/\" rel=\"noopener noreferrer nofollow\">requests<\/a><\/p>\n<\/td>\n<td data-colwidth=\"127\" width=\"127\">\n<p align=\"center\">HTTP<\/p>\n<\/td>\n<td data-colwidth=\"121\" width=\"121\">\n<p align=\"center\">TCP<\/p>\n<\/td>\n<td data-colwidth=\"128\" width=\"128\">\n<p align=\"center\">Network IO<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430\u044f Python \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0432\u0435\u0431-\u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"151\" width=\"151\">\n<p align=\"left\"><a href=\"https:\/\/docs.aiohttp.org\/en\/stable\/\" rel=\"noopener noreferrer nofollow\">aiohttp<\/a><\/p>\n<\/td>\n<td data-colwidth=\"127\" width=\"127\">\n<p align=\"center\">HTTP<\/p>\n<\/td>\n<td data-colwidth=\"121\" width=\"121\">\n<p align=\"center\">TCP<\/p>\n<\/td>\n<td data-colwidth=\"128\" width=\"128\">\n<p align=\"center\">Network IO<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430\u044f Python \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0432\u0435\u0431-\u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"151\" width=\"151\">\n<p align=\"left\"><a href=\"https:\/\/www.python-httpx.org\/\" rel=\"noopener noreferrer nofollow\">httpx<\/a><\/p>\n<\/td>\n<td data-colwidth=\"127\" width=\"127\">\n<p align=\"center\">HTTP<\/p>\n<\/td>\n<td data-colwidth=\"121\" width=\"121\">\n<p align=\"center\">TCP<\/p>\n<\/td>\n<td data-colwidth=\"128\" width=\"128\">\n<p align=\"center\">Network IO<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430\u044f\/\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430\u044f Python \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0432\u0435\u0431-\u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"151\" width=\"151\">\n<p align=\"left\"><a href=\"https:\/\/docs.python.org\/3\/library\/ftplib.html\" rel=\"noopener noreferrer nofollow\">ftplib<\/a><\/p>\n<\/td>\n<td data-colwidth=\"127\" width=\"127\">\n<p align=\"center\">FTP<\/p>\n<\/td>\n<td data-colwidth=\"121\" width=\"121\">\n<p align=\"center\">TCP<\/p>\n<\/td>\n<td data-colwidth=\"128\" width=\"128\">\n<p align=\"center\">Network IO<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430\u044f  Python \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 FTP-\u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c\u0438.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"151\" width=\"151\">\n<p align=\"left\"><a href=\"https:\/\/www.paramiko.org\/\" rel=\"noopener noreferrer nofollow\">paramiko<\/a><\/p>\n<\/td>\n<td data-colwidth=\"127\" width=\"127\">\n<p align=\"center\">SSH<\/p>\n<\/td>\n<td data-colwidth=\"121\" width=\"121\">\n<p align=\"center\">TCP<\/p>\n<\/td>\n<td data-colwidth=\"128\" width=\"128\">\n<p align=\"center\">Network IO<\/p>\n<\/td>\n<td>\n<p align=\"left\">SSH Python \u043a\u043b\u0438\u0435\u043d\u0442.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"151\" width=\"151\">\n<p align=\"left\"><a href=\"https:\/\/www.psycopg.org\/docs\/\" rel=\"noopener noreferrer nofollow\">psycopg2<\/a><\/p>\n<\/td>\n<td data-colwidth=\"127\" width=\"127\">\n<p align=\"center\"><a href=\"https:\/\/www.postgresql.org\/docs\/6.3\/c50.htm\" rel=\"noopener noreferrer nofollow\">Frontend\/Backend Protocol<\/a><\/p>\n<\/td>\n<td data-colwidth=\"121\" width=\"121\">\n<p align=\"center\">TCP<\/p>\n<\/td>\n<td data-colwidth=\"128\" width=\"128\">\n<p align=\"center\">Network IO<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 Python \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u0434\u043b\u044f \u0421\u0423\u0411\u0414 PostgreSQL.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"151\" width=\"151\">\n<p align=\"left\"><a href=\"https:\/\/pymysql.readthedocs.io\/en\/latest\/\" rel=\"noopener noreferrer nofollow\">PyMySQL<\/a><\/p>\n<\/td>\n<td data-colwidth=\"127\" width=\"127\">\n<p align=\"center\"><a href=\"https:\/\/dev.mysql.com\/doc\/dev\/mysql-server\/latest\/PAGE_PROTOCOL.html\" rel=\"noopener noreferrer nofollow\">MySQL Protocol<\/a> <\/p>\n<\/td>\n<td data-colwidth=\"121\" width=\"121\">\n<p align=\"center\">TCP<\/p>\n<\/td>\n<td data-colwidth=\"128\" width=\"128\">\n<p align=\"center\">Network IO<\/p>\n<\/td>\n<td>\n<p align=\"left\">C\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 Python \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u044b \u0434\u043b\u044f \u0421\u0423\u0411\u0414 MySQL.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"151\" width=\"151\">\n<p align=\"left\"><a href=\"https:\/\/pypi.org\/project\/aiofiles\/\" rel=\"noopener noreferrer nofollow\">aiofiles<\/a><\/p>\n<\/td>\n<td data-colwidth=\"127\" width=\"127\">\n<p align=\"center\">&#8212;<\/p>\n<\/td>\n<td data-colwidth=\"121\" width=\"121\">\n<p align=\"center\">&#8212;<\/p>\n<\/td>\n<td data-colwidth=\"128\" width=\"128\">\n<p align=\"center\">File IO<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430\u044f Python \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0444\u0430\u0439\u043b\u0430\u043c\u0438.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"151\" width=\"151\">\n<p align=\"left\"><a href=\"https:\/\/docs.python.org\/3\/library\/functions.html#open\" rel=\"noopener noreferrer nofollow\">open<\/a><\/p>\n<\/td>\n<td data-colwidth=\"127\" width=\"127\">\n<p align=\"center\">&#8212;<\/p>\n<\/td>\n<td data-colwidth=\"121\" width=\"121\">\n<p align=\"center\">&#8212;<\/p>\n<\/td>\n<td data-colwidth=\"128\" width=\"128\">\n<p align=\"center\">File IO<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430\u044f Python \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"151\" width=\"151\">\n<p align=\"left\">touch, cat, more<\/p>\n<\/td>\n<td data-colwidth=\"127\" width=\"127\">\n<p align=\"center\">&#8212;<\/p>\n<\/td>\n<td data-colwidth=\"121\" width=\"121\">\n<p align=\"center\">&#8212;<\/p>\n<\/td>\n<td data-colwidth=\"128\" width=\"128\">\n<p align=\"center\">Console IO<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0435 UNIX \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0444\u0430\u0439\u043b\u0430\u043c\u0438.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"151\" width=\"151\">\n<p align=\"left\"><a href=\"https:\/\/docs.python.org\/3\/library\/multiprocessing.shared_memory.html\" rel=\"noopener noreferrer nofollow\">shared_memory<\/a><\/p>\n<\/td>\n<td data-colwidth=\"127\" width=\"127\">\n<p align=\"center\">&#8212;<\/p>\n<\/td>\n<td data-colwidth=\"121\" width=\"121\">\n<p align=\"center\">&#8212;<\/p>\n<\/td>\n<td data-colwidth=\"128\" width=\"128\">\n<p align=\"center\">Inter-Process IO<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043e\u0431\u0449\u0435\u0439 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438 \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"151\" width=\"151\">\n<p align=\"left\"><a href=\"https:\/\/pyserial.readthedocs.io\/en\/latest\/pyserial.html\" rel=\"noopener noreferrer nofollow\">pyserial<\/a><\/p>\n<\/td>\n<td data-colwidth=\"127\" width=\"127\">\n<p align=\"center\">&#8212;<\/p>\n<\/td>\n<td data-colwidth=\"121\" width=\"121\">\n<p align=\"center\">&#8212;<\/p>\n<\/td>\n<td data-colwidth=\"128\" width=\"128\">\n<p align=\"center\">Device IO<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u043e\u0440\u0442\u0430\u043c\u0438 \u0438  \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u043c\u0438.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0412\u0441\u0435 \u044d\u0442\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430\u043c\u0438: \u0441 \u0444\u0430\u0439\u043b\u0430\u043c\u0438, \u0432\u0435\u0431-\u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438, \u0421\u0423\u0411\u0414, \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c\u0438, \u043f\u043e\u0440\u0442\u0430\u043c\u0438, \u043f\u0430\u043c\u044f\u0442\u044c\u044e. <\/p>\n<p>\u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0442\u043e\u043b\u044c\u043a\u043e <strong>Network IO<\/strong>.<\/p>\n<h2>\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b Network IO<\/h2>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u043e\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u043c \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 Python. \u0414\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e API: <a href=\"http:\/\/jsonplaceholder.typicode.com\/posts\/1\" rel=\"noopener noreferrer nofollow\">http:\/\/jsonplaceholder.typicode.com\/posts\/1<\/a> \u041d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043d \u043f\u043e \u0448\u0430\u0433\u0430\u043c.<\/p>\n<pre><code class=\"python\">import socket  class Fetch:      def __init__(self):         self._port = 80         self.path = \"\/posts\/1\"         self.host = \"jsonplaceholder.typicode.com\"         self.response = b\"\"         self._family = socket.AF_INET         self._type = socket.SOCK_STREAM      def __call__(self) -&gt; bytes:         ip = self.request_to_dns()          # 1         request = self.create_request()     # 2         sock = self.create_socket()         # 3         sock.connect((ip, self._port))      # 4         sock.sendall(request)               # 5         self.read_response(sock)            # 6         sock.close()         print(\"Socket is closed\\n\")         return self.response      def request_to_dns(self) -&gt; str:         response = socket.getaddrinfo(self.host, self._port, self._family, self._type)         print(f\"Response from dns: {response}\")         first_tuple = response[0]         print(f\"First tuple in response from dns: {first_tuple}\")         ip = first_tuple[4][0]         print(f\"Resolved: {self.host} -&gt; {ip}:{self._port}\")         return ip      def create_socket(self):         sock = socket.socket(self._family, self._type)         print(\"Socket created\")         return sock      def create_request(self) -&gt; bytes:         headers = [f\"Host: {self.host}\", \"Connection: close\"]         http_request = f\"GET {self.path} HTTP\/1.1\\r\\n\" + \"\\r\\n\".join(headers) + \"\\r\\n\\r\\n\"         print(f\"Create HTTP request\")         return http_request.encode()      def read_response(self, sock):         print(\"Wait for response\")         while True:             chunk = sock.recv(4096)             if not chunk:                 break             self.response += chunk  print(Fetch()().decode())<\/code><\/pre>\n<h2>\u0428\u0430\u0433 \u043f\u0435\u0440\u0432\u044b\u0439 &#8212; \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 DNS<\/h2>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0442 Web \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u043d\u0430\u043c \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u0441\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0435\u0433\u043e \u0430\u0434\u0440\u0435\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 DNS. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/docs.python.org\/3\/library\/socket.html#socket.getaddrinfo\" rel=\"noopener noreferrer nofollow\">socket.getaddrinfo<\/a> \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u0435\u0440\u0442\u043a\u043e\u0439 \u043d\u0430\u0434 <a href=\"https:\/\/en.wikipedia.org\/wiki\/C_standard_library\" rel=\"noopener noreferrer nofollow\">libc<\/a>, \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u044f\u0437\u044b\u043a\u0430 \u0421\u0438. \u0414\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0438 \u0432 \u0432\u0438\u0434\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u0432\u0441\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u0430(IPv4 \u0438\u043b\u0438 IPv6) \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/p>\n<p>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b <code>socket.getaddrinfo<\/code>:<\/p>\n<ul>\n<li>\n<p>family &#8212; \u0421\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u043e \u0430\u0434\u0440\u0435\u0441\u043e\u0432(socket.AF_INET (IPv4), socket.AF_INET6 (IPv6), etc);<\/p>\n<\/li>\n<li>\n<p>type &#8212; \u0422\u0438\u043f \u0441\u043e\u043a\u0435\u0442\u0430(socket.SOCK_STREAM (TCP), socket.SOCK_DGRAM (UDP), etc);<\/p>\n<\/li>\n<li>\n<p>proto &#8212; \u0423\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430(socket.IPPROTO_TCP, socket.IPPROTO_UDP);<\/p>\n<\/li>\n<li>\n<p>flags &#8212; \u0424\u043b\u0430\u0433\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0430;<\/p>\n<\/li>\n<\/ul>\n<h2>\u0428\u0430\u0433 \u0432\u0442\u043e\u0440\u043e\u0439 &#8212; \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430<\/h2>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u0448\u0430\u0433 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435 HTTP \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b HTTP (\u0432\u0435\u0440\u0441\u0438\u0438 1.1). <\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f.<\/p>\n<pre><code>GET \/articles\/42 HTTP\/1.1       \/\/ Request line. \u0425\u0440\u0430\u043d\u0438\u0442 \u043c\u0435\u0442\u043e\u0434, \u043f\u0443\u0442\u044c \u0438 \u0432\u0435\u0440\u0441\u0438\u044e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430. Host: example.com               Host: example.com               \/\/ \u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0432 HTTP\/1.1. \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u043e\u043c\u0435\u043d\u043d\u043e\u0435 \u0438\u043c\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0430. Connection: close               \/\/ \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u043e\u0442\u0432\u0435\u0442\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043a\u0440\u044b\u0442\u044c. User-Agent: CustomClient\/1.0    \/\/ \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a, \u0441\u043e\u043e\u0431\u0449\u0430\u044e\u0449\u0438\u0439 \u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u043a\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441(Iphone, Bot, Mac, etc).  Accept: application\/json        \/\/ \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u043a\u043b\u0438\u0435\u043d\u0442 \u0433\u043e\u0442\u043e\u0432 \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u0442\u0438\u043f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0432 \u043e\u0442\u0432\u0435\u0442. ...                             \/\/ \u0415\u0449\u0435 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438.                                 \/\/ \u041f\u0443\u0441\u0442\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u0433\u043e\u043b\u043e\u0432\u044b \u0438 \u0442\u0435\u043b\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430. name=John+Doe&amp;age=30&amp;city=NY    \/\/ \u0422\u0435\u043b\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0414\u043b\u044f GET \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f.<\/code><\/pre>\n<p> \u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0447\u0442\u043e \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043e\u0442 \u043d\u0435\u0433\u043e:<\/p>\n<ul>\n<li>\n<p>\u0417\u0430\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u043b\u0438 \u0441\u0440\u0430\u0437\u0443 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435?<\/p>\n<\/li>\n<li>\n<p>\u0412 \u043a\u0430\u043a\u043e\u0439 \u0445\u043e\u0441\u0442 \u043c\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441?<\/p>\n<\/li>\n<li>\n<p>\u0412 \u043a\u0430\u043a\u043e\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e API \u043c\u044b \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f?<\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u043a\u043e\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c?<\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u043a\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f?<\/p>\n<\/li>\n<li>\n<p>\u0427\u0442\u043e \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c(GET &#8212; \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u043b\u0438 POST &#8212; \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435)?<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0433\u043e\u0442\u043e\u0432\u043e, \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0435\u0433\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0431\u0430\u0439\u0442\u044b.<\/p>\n<h2>\u0428\u0430\u0433 \u0442\u0440\u0435\u0442\u0438\u0439 &#8212; \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u043e\u043a\u0435\u0442\u0430<\/h2>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0441\u043e\u043a\u0435\u0442, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0430\u043c\u043e\u043f\u0438\u0441\u043d\u044b\u0439 \u043a\u043b\u0438\u0435\u043d\u0442 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0449\u0430\u0442\u044c\u0441\u044f \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u043f\u043e \u0441\u0435\u0442\u0438. \u0421\u043e\u043a\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 TCP \u0434\u043b\u044f \u043d\u0430\u0434\u0451\u0436\u043d\u043e\u0439 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. <\/p>\n<p>\u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0441\u043e\u043a\u0435\u0442\u0430 \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u043b\u0438 \u0434\u0432\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430:\u0434\u043b\u044f \u043d\u0430\u0434\u0451\u0436\u043d\u043e\u0439<\/p>\n<ul>\n<li>\n<p>AF_INET &#8212; \u0427\u0438\u0441\u043b\u043e 2, \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u0435 \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u043e IPv4. <\/p>\n<\/li>\n<li>\n<p>SOCK_STREAM &#8212; \u0427\u0438\u0441\u043b\u043e 1, \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b TCP, \u0430 \u043d\u0435 UDP. <\/p>\n<\/li>\n<\/ul>\n<h2>\u0428\u0430\u0433 \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u044b\u0439 &#8212; \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f<\/h2>\n<p>\u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 <a href=\"https:\/\/docs.python.org\/3\/library\/socket.html#socket.socket.connect\" rel=\"noopener noreferrer nofollow\">sock.connect<\/a> \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0430\u0434\u0440\u0435\u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u0435\u0433\u043e \u043f\u043e\u0440\u0442. \u0414\u0430\u043b\u0435\u0435 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 TCP \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 <a href=\"https:\/\/datatracker.ietf.org\/doc\/html\/rfc793#section-3.4\" rel=\"noopener noreferrer nofollow\">\u0442\u0440\u0451\u0445\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0435 \u0440\u0443\u043a\u043e\u043f\u043e\u0436\u0430\u0442\u0438\u0435<\/a> \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0434\u0430\u043b\u0435\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435.<\/p>\n<h2>\u0428\u0430\u0433 \u043f\u044f\u0442\u044b\u0439 &#8212; \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f<\/h2>\n<p>\u0417\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0432 \u0431\u0430\u0439\u0442\u044b \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e \u043a\u0443\u0441\u043a\u0430\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0438 \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0451 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 <a href=\"https:\/\/docs.python.org\/3\/library\/socket.html#socket.socket.sendall\" rel=\"noopener noreferrer nofollow\">sock.sendall(request)<\/a>.<\/p>\n<h2>\u0428\u0430\u0433 \u0448\u0435\u0441\u0442\u043e\u0439 &#8212; \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043e\u0442\u0432\u0435\u0442\u0430<\/h2>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u043d\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0443\u0433\u0430\u0434\u0430\u0442\u044c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0431\u0430\u0439\u0442\u043e\u0432 \u043f\u0440\u0438\u0434\u0435\u0442 \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0442\u043e \u0435\u0441\u0442\u044c \u0434\u043b\u0438\u043d\u043d\u0430 \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0446\u0438\u043a\u043b\u0430 \u0438 <a href=\"https:\/\/docs.python.org\/3\/library\/socket.html#socket.socket.recv\" rel=\"noopener noreferrer nofollow\">socket.recv(size)<\/a> \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442 \u043f\u043e \u043a\u0443\u0441\u043e\u0447\u043a\u0430. \u041f\u0440\u0438\u043c\u0435\u0440\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440\u043e \u043a\u0443\u0441\u043e\u0447\u043a\u043e\u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 4 \u043a\u0431. \u041f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u043d\u0430\u043f\u043e\u043b\u043d\u044f\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 <code>self.response<\/code> \u0434\u0430\u043d\u043d\u044b\u043c\u0438. <\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u0435, \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <code>size=4096<\/code> \u0438 \u044d\u0442\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u043d\u0435 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u0430\u044f \u0446\u0438\u0444\u0440\u0430. <\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u043e \u043e\u043d \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u043f\u0443\u0441\u0442\u043e\u0439 \u0431\u0430\u0439\u0442\u043e\u0432\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 <code>b''<\/code> \u0447\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u043c \u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438.<\/p>\n<h2>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b:<\/h2>\n<h2>\u041a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u0441\u0435 IP \u0430\u0434\u0440\u0435\u0441\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e socket.getaddrinfo?<\/h2>\n<p>\u042d\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e, \u043f\u0435\u0440\u0435\u0434\u0430\u0439\u0442\u0435 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432\u0441\u0435\u0433\u043e \u0434\u0432\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430: <code>host<\/code> \u0438 <code>port<\/code>. \u041a\u0430\u043a \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0438\u0436\u0435:<\/p>\n<pre><code class=\"python\">import socket from pprint import pprint  response = socket.getaddrinfo(host=\"jsonplaceholder.typicode.com\", port=80)  ipv4, ipv6 = set(), set() for address_tuple in response:     address = address_tuple[-1][0]     if \".\" in address:         ipv4.add(address)         continue     ipv6.add(address)  print(\"IPv4\") pprint(ipv4) print() print(\"IPv6\") pprint(ipv6)<\/code><\/pre>\n<h2>\u041a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c IP \u0430\u0434\u0440\u0435\u0441\u0430 \u0431\u0435\u0437 Python?<\/h2>\n<p>\u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f IP \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430 \u0432 Linux \u0441\u0442\u043e\u0438\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0442\u0438\u043b\u0438\u0442\u0443 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Dig_(command)\" rel=\"noopener noreferrer nofollow\">dig<\/a>.\u0422\u0430\u043a \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u043c HTTP GET \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e. \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b. \u041d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u043d <a href=\"https:\/\/datatracker.ietf.org\/doc\/html\/rfc1035\" rel=\"noopener noreferrer nofollow\">DNS-\u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u043c<\/a>.<\/p>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430: <code>dig jsonplaceholder.typicode.com +short<\/code><\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u0432\u043e\u0434\u0430-\u0432\u044b\u0432\u043e\u0434\u0430 (IO). \u041e\u0441\u043e\u0431\u043e\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u0443\u0434\u0435\u043b\u0435\u043d\u043e \u0441\u0435\u0442\u0435\u0432\u043e\u043c\u0443 \u0432\u0432\u043e\u0434\u0443-\u0432\u044b\u0432\u043e\u0434\u0443 (Network IO) \u0438 \u0442\u043e\u043c\u0443, \u043a\u0430\u043a \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u043d\u0438\u0437\u043a\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <code>socket<\/code>. <\/p>\n<p>\u0420\u0430\u0437\u043e\u0431\u0440\u0430\u0432 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u0440\u0443\u0447\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043c\u044b \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043f\u0440\u043e\u0448\u043b\u0438 \u0432\u0441\u0435 \u044d\u0442\u0430\u043f\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f: \u043e\u0442 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f DNS-\u0438\u043c\u0435\u043d\u0438 \u0434\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043e\u0442\u0432\u0435\u0442\u0430 \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430. <\/p>\n<p>\u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0432\u044b\u0441\u043e\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, requests, aiohttp) \u0438 \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 &#171;\u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c&#187; \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0441\u0435\u0442\u044c\u044e.<\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043a\u0430\u0436\u0443\u0442 \u0447\u0442\u043e \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u043e\u043b\u043d\u0430\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u0442\u0443\u0442 \u043d\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u0435\u043c\u0430 \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 HTTP, \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043d\u043e \u043f\u0440\u043e DNS, \u043d\u0435 \u0437\u0430\u0442\u0440\u043e\u043d\u0443\u0442\u044b \u0442\u0435\u043c\u044b \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 Linux. \u041d\u043e \u0437\u0430\u0434\u0430\u0447\u0430 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0434\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u0435 \u0431\u0430\u0437\u043e\u0432\u043e\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 NetworkIO.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u0430\u0441\u044c \u0441\u0442\u0430\u0442\u044c\u044f, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0435 \u043c\u0438\u043d\u0438-\u0440\u0443\u0431\u0440\u0438\u043a\u0438 \u0432 \u043c\u043e\u0435\u043c <a href=\"https:\/\/t.me\/code_on_server\" rel=\"noopener noreferrer nofollow\">Telegram<\/a> \u043a\u0430\u043d\u0430\u043b\u0435.<\/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\/928694\/\"> https:\/\/habr.com\/ru\/articles\/928694\/<\/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>\u0412\u0441\u0435 \u043c\u044b \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0446\u0435\u043b\u0435\u0439. \u0411\u0430\u043d\u043a\u043e\u0432\u0441\u043a\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441 \u0434\u0435\u043d\u0435\u0436\u043d\u044b\u043c\u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438, \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440\u044b \u0434\u043b\u044f \u043e\u0431\u0449\u0435\u043d\u0438\u044f. \u041e\u043d\u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u0432\u043d\u0443\u0442\u0440\u044c \u0441\u0435\u0431\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043e\u0442 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u043e\u0442\u0432\u0435\u0442. \u0411\u0430\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043e\u0442\u0432\u0435\u0442, \u043d\u043e \u044d\u0442\u043e \u0442\u0430\u043a \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u0437\u0433\u043b\u044f\u0434\u0430. \u042d\u0442\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f Input Output \u0438 \u043e\u043d\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u043e\u0439 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0435\u0439 \u0432 \u0441\u0435\u0442\u0438. \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u043e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442.<\/p>\n<h2>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435<\/h2>\n<p><strong>\u041e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u0432\u043e\u0434\u0430-\u0432\u044b\u0432\u043e\u0434\u0430 (I\/O) <\/strong> &#8212; \u044d\u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b \u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435\u043c \u0438\u043b\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u043d\u0438 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430\u043c\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439, \u0441\u0435\u0442\u044c\u044e, \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445, \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u0438 \u0442.\u0434.). \u0412 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e I\/O \u043e\u043d\u0438 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e.<\/p>\n<p>\u0412 <strong>\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0435\u043c\/\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u043c<\/strong> \u0440\u0435\u0436\u0438\u043c\u0435 \u043e\u043d\u0438 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0432 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0438 \u043e\u0442\u0432\u0435\u0442\u0430 \u043e\u0442 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438\u043b\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430.<\/p>\n<p>\u0412 <strong>\u043d\u0435\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0435\u043c\/\u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u043c<\/strong> \u0440\u0435\u0436\u0438\u043c\u0435 \u043e\u043d\u0438 \u043d\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0432 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0438 \u043e\u0442\u0432\u0435\u0442\u0430 \u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442\u0441\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \u043d\u043e\u0432\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/p>\n<h2>\u041a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f IO<\/h2>\n<p>\u0413\u0440\u0443\u0431\u043e \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0433\u0440\u0443\u043f\u043f, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043c\u043d\u043e\u044e \u043d\u0435 \u0431\u044b\u043b\u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043e:<\/p>\n<ul>\n<li>\n<p><strong>File IO<\/strong> &#8212; \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430\u043c\u0438 \u043d\u0430 \u0434\u0438\u0441\u043a\u0435 \u0447\u0435\u0440\u0435\u0437 \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443;<\/p>\n<\/li>\n<li>\n<p><strong>Device IO<\/strong> &#8212; \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432: \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u044b, \u043c\u044b\u0448\u0438, \u0434\u0438\u0441\u043a\u0438, &#8230;;<\/p>\n<\/li>\n<li>\n<p><strong>Console IO<\/strong> &#8212; \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0432\u0432\u043e\u0434\u043e\u043c\/\u0432\u044b\u0432\u043e\u0434\u043e\u043c \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435;<\/p>\n<\/li>\n<li>\n<p><strong>Network IO<\/strong> &#8212; \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u043e \u0441\u0435\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u0441\u043e\u043a\u0435\u0442\u044b;<\/p>\n<\/li>\n<li>\n<p><strong>Inter-Process IO<\/strong> &#8212; \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438 \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430;<\/p>\n<\/li>\n<\/ul>\n<h2>\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b IO<\/h2>\n<p>\u0412 Python \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c IO. \u041a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u043d\u0438\u0445 \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f. \u041f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u0432\u0441\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e IO \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c, \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c \u043f\u0440\u043e \u0441\u0430\u043c\u044b\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0438 \u0447\u0443\u0442\u044c-\u0447\u0443\u0442\u044c \u0437\u0430\u0442\u0440\u043e\u043d\u0435\u043c Linux \u0443\u0442\u0438\u043b\u0438\u0442\u044b.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"151\" width=\"151\">\n<p align=\"center\">\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442<\/p>\n<\/td>\n<td data-colwidth=\"127\" width=\"127\">\n<p align=\"center\">\u041f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b<\/p>\n<\/td>\n<td data-colwidth=\"121\" width=\"121\">\n<p align=\"center\">\u0422\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u043d\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b<\/p>\n<\/td>\n<td data-colwidth=\"128\" width=\"128\">\n<p align=\"center\">\u0422\u0438\u043f <\/p>\n<\/td>\n<td>\n<p align=\"center\">\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"151\" width=\"151\">\n<p align=\"left\"><a href=\"https:\/\/requests.readthedocs.io\/en\/latest\/\" rel=\"noopener noreferrer nofollow\">requests<\/a><\/p>\n<\/td>\n<td data-colwidth=\"127\" width=\"127\">\n<p align=\"center\">HTTP<\/p>\n<\/td>\n<td data-colwidth=\"121\" width=\"121\">\n<p align=\"center\">TCP<\/p>\n<\/td>\n<td data-colwidth=\"128\" width=\"128\">\n<p align=\"center\">Network IO<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430\u044f Python \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0432\u0435\u0431-\u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"151\" width=\"151\">\n<p align=\"left\"><a href=\"https:\/\/docs.aiohttp.org\/en\/stable\/\" rel=\"noopener noreferrer nofollow\">aiohttp<\/a><\/p>\n<\/td>\n<td data-colwidth=\"127\" width=\"127\">\n<p align=\"center\">HTTP<\/p>\n<\/td>\n<td data-colwidth=\"121\" width=\"121\">\n<p align=\"center\">TCP<\/p>\n<\/td>\n<td data-colwidth=\"128\" width=\"128\">\n<p align=\"center\">Network IO<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430\u044f Python \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0432\u0435\u0431-\u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"151\" width=\"151\">\n<p align=\"left\"><a href=\"https:\/\/www.python-httpx.org\/\" rel=\"noopener noreferrer nofollow\">httpx<\/a><\/p>\n<\/td>\n<td data-colwidth=\"127\" width=\"127\">\n<p align=\"center\">HTTP<\/p>\n<\/td>\n<td data-colwidth=\"121\" width=\"121\">\n<p align=\"center\">TCP<\/p>\n<\/td>\n<td data-colwidth=\"128\" width=\"128\">\n<p align=\"center\">Network IO<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430\u044f\/\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430\u044f Python \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0432\u0435\u0431-\u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"151\" width=\"151\">\n<p align=\"left\"><a href=\"https:\/\/docs.python.org\/3\/library\/ftplib.html\" rel=\"noopener noreferrer nofollow\">ftplib<\/a><\/p>\n<\/td>\n<td data-colwidth=\"127\" width=\"127\">\n<p align=\"center\">FTP<\/p>\n<\/td>\n<td data-colwidth=\"121\" width=\"121\">\n<p align=\"center\">TCP<\/p>\n<\/td>\n<td data-colwidth=\"128\" width=\"128\">\n<p align=\"center\">Network IO<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430\u044f  Python \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 FTP-\u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c\u0438.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"151\" width=\"151\">\n<p align=\"left\"><a href=\"https:\/\/www.paramiko.org\/\" rel=\"noopener noreferrer nofollow\">paramiko<\/a><\/p>\n<\/td>\n<td data-colwidth=\"127\" width=\"127\">\n<p align=\"center\">SSH<\/p>\n<\/td>\n<td data-colwidth=\"121\" width=\"121\">\n<p align=\"center\">TCP<\/p>\n<\/td>\n<td data-colwidth=\"128\" width=\"128\">\n<p align=\"center\">Network IO<\/p>\n<\/td>\n<td>\n<p align=\"left\">SSH Python \u043a\u043b\u0438\u0435\u043d\u0442.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"151\" width=\"151\">\n<p align=\"left\"><a href=\"https:\/\/www.psycopg.org\/docs\/\" rel=\"noopener noreferrer nofollow\">psycopg2<\/a><\/p>\n<\/td>\n<td data-colwidth=\"127\" width=\"127\">\n<p align=\"center\"><a href=\"https:\/\/www.postgresql.org\/docs\/6.3\/c50.htm\" rel=\"noopener noreferrer nofollow\">Frontend\/Backend Protocol<\/a><\/p>\n<\/td>\n<td data-colwidth=\"121\" width=\"121\">\n<p align=\"center\">TCP<\/p>\n<\/td>\n<td data-colwidth=\"128\" width=\"128\">\n<p align=\"center\">Network IO<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 Python \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u0434\u043b\u044f \u0421\u0423\u0411\u0414 PostgreSQL.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"151\" width=\"151\">\n<p align=\"left\"><a href=\"https:\/\/pymysql.readthedocs.io\/en\/latest\/\" rel=\"noopener noreferrer nofollow\">PyMySQL<\/a><\/p>\n<\/td>\n<td data-colwidth=\"127\" width=\"127\">\n<p align=\"center\"><a href=\"https:\/\/dev.mysql.com\/doc\/dev\/mysql-server\/latest\/PAGE_PROTOCOL.html\" rel=\"noopener noreferrer nofollow\">MySQL Protocol<\/a> <\/p>\n<\/td>\n<td data-colwidth=\"121\" width=\"121\">\n<p align=\"center\">TCP<\/p>\n<\/td>\n<td data-colwidth=\"128\" width=\"128\">\n<p align=\"center\">Network IO<\/p>\n<\/td>\n<td>\n<p align=\"left\">C\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 Python \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u044b \u0434\u043b\u044f \u0421\u0423\u0411\u0414 MySQL.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"151\" width=\"151\">\n<p align=\"left\"><a href=\"https:\/\/pypi.org\/project\/aiofiles\/\" rel=\"noopener noreferrer nofollow\">aiofiles<\/a><\/p>\n<\/td>\n<td data-colwidth=\"127\" width=\"127\">\n<p align=\"center\">&#8212;<\/p>\n<\/td>\n<td data-colwidth=\"121\" width=\"121\">\n<p align=\"center\">&#8212;<\/p>\n<\/td>\n<td data-colwidth=\"128\" width=\"128\">\n<p align=\"center\">File IO<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430\u044f Python \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0444\u0430\u0439\u043b\u0430\u043c\u0438.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"151\" width=\"151\">\n<p align=\"left\"><a href=\"https:\/\/docs.python.org\/3\/library\/functions.html#open\" rel=\"noopener noreferrer nofollow\">open<\/a><\/p>\n<\/td>\n<td data-colwidth=\"127\" width=\"127\">\n<p align=\"center\">&#8212;<\/p>\n<\/td>\n<td data-colwidth=\"121\" width=\"121\">\n<p align=\"center\">&#8212;<\/p>\n<\/td>\n<td data-colwidth=\"128\" width=\"128\">\n<p align=\"center\">File IO<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430\u044f Python \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"151\" width=\"151\">\n<p align=\"left\">touch, cat, more<\/p>\n<\/td>\n<td data-colwidth=\"127\" width=\"127\">\n<p align=\"center\">&#8212;<\/p>\n<\/td>\n<td data-colwidth=\"121\" width=\"121\">\n<p align=\"center\">&#8212;<\/p>\n<\/td>\n<td data-colwidth=\"128\" width=\"128\">\n<p align=\"center\">Console IO<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0435 UNIX \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0444\u0430\u0439\u043b\u0430\u043c\u0438.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"151\" width=\"151\">\n<p align=\"left\"><a href=\"https:\/\/docs.python.org\/3\/library\/multiprocessing.shared_memory.html\" rel=\"noopener noreferrer nofollow\">shared_memory<\/a><\/p>\n<\/td>\n<td data-colwidth=\"127\" width=\"127\">\n<p align=\"center\">&#8212;<\/p>\n<\/td>\n<td data-colwidth=\"121\" width=\"121\">\n<p align=\"center\">&#8212;<\/p>\n<\/td>\n<td data-colwidth=\"128\" width=\"128\">\n<p align=\"center\">Inter-Process IO<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043e\u0431\u0449\u0435\u0439 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438 \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"151\" width=\"151\">\n<p align=\"left\"><a href=\"https:\/\/pyserial.readthedocs.io\/en\/latest\/pyserial.html\" rel=\"noopener noreferrer nofollow\">pyserial<\/a><\/p>\n<\/td>\n<td data-colwidth=\"127\" width=\"127\">\n<p align=\"center\">&#8212;<\/p>\n<\/td>\n<td data-colwidth=\"121\" width=\"121\">\n<p align=\"center\">&#8212;<\/p>\n<\/td>\n<td data-colwidth=\"128\" width=\"128\">\n<p align=\"center\">Device IO<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u043e\u0440\u0442\u0430\u043c\u0438 \u0438  \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u043c\u0438.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0412\u0441\u0435 \u044d\u0442\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430\u043c\u0438: \u0441 \u0444\u0430\u0439\u043b\u0430\u043c\u0438, \u0432\u0435\u0431-\u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438, \u0421\u0423\u0411\u0414, \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c\u0438, \u043f\u043e\u0440\u0442\u0430\u043c\u0438, \u043f\u0430\u043c\u044f\u0442\u044c\u044e. <\/p>\n<p>\u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0442\u043e\u043b\u044c\u043a\u043e <strong>Network IO<\/strong>.<\/p>\n<h2>\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b Network IO<\/h2>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u043e\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u043c \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 Python. \u0414\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e API: <a href=\"http:\/\/jsonplaceholder.typicode.com\/posts\/1\" rel=\"noopener noreferrer nofollow\">http:\/\/jsonplaceholder.typicode.com\/posts\/1<\/a> \u041d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043d \u043f\u043e \u0448\u0430\u0433\u0430\u043c.<\/p>\n<pre><code class=\"python\">import socket  class Fetch:      def __init__(self):         self._port = 80         self.path = \"\/posts\/1\"         self.host = \"jsonplaceholder.typicode.com\"         self.response = b\"\"         self._family = socket.AF_INET         self._type = socket.SOCK_STREAM      def __call__(self) -&gt; bytes:         ip = self.request_to_dns()          # 1         request = self.create_request()     # 2         sock = self.create_socket()         # 3         sock.connect((ip, self._port))      # 4         sock.sendall(request)               # 5         self.read_response(sock)            # 6         sock.close()         print(\"Socket is closed\\n\")         return self.response      def request_to_dns(self) -&gt; str:         response = socket.getaddrinfo(self.host, self._port, self._family, self._type)         print(f\"Response from dns: {response}\")         first_tuple = response[0]         print(f\"First tuple in response from dns: {first_tuple}\")         ip = first_tuple[4][0]         print(f\"Resolved: {self.host} -&gt; {ip}:{self._port}\")         return ip      def create_socket(self):         sock = socket.socket(self._family, self._type)         print(\"Socket created\")         return sock      def create_request(self) -&gt; bytes:         headers = [f\"Host: {self.host}\", \"Connection: close\"]         http_request = f\"GET {self.path} HTTP\/1.1\\r\\n\" + \"\\r\\n\".join(headers) + \"\\r\\n\\r\\n\"         print(f\"Create HTTP request\")         return http_request.encode()      def read_response(self, sock):         print(\"Wait for response\")         while True:             chunk = sock.recv(4096)             if not chunk:                 break             self.response += chunk  print(Fetch()().decode())<\/code><\/pre>\n<h2>\u0428\u0430\u0433 \u043f\u0435\u0440\u0432\u044b\u0439 &#8212; \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 DNS<\/h2>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0442 Web \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u043d\u0430\u043c \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u0441\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0435\u0433\u043e \u0430\u0434\u0440\u0435\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 DNS. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/docs.python.org\/3\/library\/socket.html#socket.getaddrinfo\" rel=\"noopener noreferrer nofollow\">socket.getaddrinfo<\/a> \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u0435\u0440\u0442\u043a\u043e\u0439 \u043d\u0430\u0434 <a href=\"https:\/\/en.wikipedia.org\/wiki\/C_standard_library\" rel=\"noopener noreferrer nofollow\">libc<\/a>, \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u044f\u0437\u044b\u043a\u0430 \u0421\u0438. \u0414\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0438 \u0432 \u0432\u0438\u0434\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u0432\u0441\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u0430(IPv4 \u0438\u043b\u0438 IPv6) \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/p>\n<p>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b <code>socket.getaddrinfo<\/code>:<\/p>\n<ul>\n<li>\n<p>family &#8212; \u0421\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u043e \u0430\u0434\u0440\u0435\u0441\u043e\u0432(socket.AF_INET (IPv4), socket.AF_INET6 (IPv6), etc);<\/p>\n<\/li>\n<li>\n<p>type &#8212; \u0422\u0438\u043f \u0441\u043e\u043a\u0435\u0442\u0430(socket.SOCK_STREAM (TCP), socket.SOCK_DGRAM (UDP), etc);<\/p>\n<\/li>\n<li>\n<p>proto &#8212; \u0423\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430(socket.IPPROTO_TCP, socket.IPPROTO_UDP);<\/p>\n<\/li>\n<li>\n<p>flags &#8212; \u0424\u043b\u0430\u0433\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0430;<\/p>\n<\/li>\n<\/ul>\n<h2>\u0428\u0430\u0433 \u0432\u0442\u043e\u0440\u043e\u0439 &#8212; \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430<\/h2>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u0448\u0430\u0433 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435 HTTP \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b HTTP (\u0432\u0435\u0440\u0441\u0438\u0438 1.1). <\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f.<\/p>\n<pre><code>GET \/articles\/42 HTTP\/1.1       \/\/ Request line. \u0425\u0440\u0430\u043d\u0438\u0442 \u043c\u0435\u0442\u043e\u0434, \u043f\u0443\u0442\u044c \u0438 \u0432\u0435\u0440\u0441\u0438\u044e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430. Host: example.com               Host: example.com               \/\/ \u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0432 HTTP\/1.1. \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u043e\u043c\u0435\u043d\u043d\u043e\u0435 \u0438\u043c\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0430. Connection: close               \/\/ \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u043e\u0442\u0432\u0435\u0442\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043a\u0440\u044b\u0442\u044c. User-Agent: CustomClient\/1.0    \/\/ \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a, \u0441\u043e\u043e\u0431\u0449\u0430\u044e\u0449\u0438\u0439 \u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u043a\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441(Iphone, Bot, Mac, etc).  Accept: application\/json        \/\/ \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u043a\u043b\u0438\u0435\u043d\u0442 \u0433\u043e\u0442\u043e\u0432 \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u0442\u0438\u043f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0432 \u043e\u0442\u0432\u0435\u0442. ...                             \/\/ \u0415\u0449\u0435 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438.                                 \/\/ \u041f\u0443\u0441\u0442\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u0433\u043e\u043b\u043e\u0432\u044b \u0438 \u0442\u0435\u043b\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430. name=John+Doe&amp;age=30&amp;city=NY    \/\/ \u0422\u0435\u043b\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0414\u043b\u044f GET \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f.<\/code><\/pre>\n<p> \u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0447\u0442\u043e \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043e\u0442 \u043d\u0435\u0433\u043e:<\/p>\n<ul>\n<li>\n<p>\u0417\u0430\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u043b\u0438 \u0441\u0440\u0430\u0437\u0443 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435?<\/p>\n<\/li>\n<li>\n<p>\u0412 \u043a\u0430\u043a\u043e\u0439 \u0445\u043e\u0441\u0442 \u043c\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441?<\/p>\n<\/li>\n<li>\n<p>\u0412 \u043a\u0430\u043a\u043e\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e API \u043c\u044b \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f?<\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u043a\u043e\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c?<\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u043a\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f?<\/p>\n<\/li>\n<li>\n<p>\u0427\u0442\u043e \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c(GET &#8212; \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u043b\u0438 POST &#8212; \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435)?<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0433\u043e\u0442\u043e\u0432\u043e, \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0435\u0433\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0431\u0430\u0439\u0442\u044b.<\/p>\n<h2>\u0428\u0430\u0433 \u0442\u0440\u0435\u0442\u0438\u0439 &#8212; \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u043e\u043a\u0435\u0442\u0430<\/h2>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0441\u043e\u043a\u0435\u0442, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0430\u043c\u043e\u043f\u0438\u0441\u043d\u044b\u0439 \u043a\u043b\u0438\u0435\u043d\u0442 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0449\u0430\u0442\u044c\u0441\u044f \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u043f\u043e \u0441\u0435\u0442\u0438. \u0421\u043e\u043a\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 TCP \u0434\u043b\u044f \u043d\u0430\u0434\u0451\u0436\u043d\u043e\u0439 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. <\/p>\n<p>\u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0441\u043e\u043a\u0435\u0442\u0430 \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u043b\u0438 \u0434\u0432\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430:\u0434\u043b\u044f \u043d\u0430\u0434\u0451\u0436\u043d\u043e\u0439<\/p>\n<ul>\n<li>\n<p>AF_INET &#8212; \u0427\u0438\u0441\u043b\u043e 2, \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u0435 \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u043e IPv4. <\/p>\n<\/li>\n<li>\n<p>SOCK_STREAM &#8212; \u0427\u0438\u0441\u043b\u043e 1, \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b TCP, \u0430 \u043d\u0435 UDP. <\/p>\n<\/li>\n<\/ul>\n<h2>\u0428\u0430\u0433 \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u044b\u0439 &#8212; \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f<\/h2>\n<p>\u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 <a href=\"https:\/\/docs.python.org\/3\/library\/socket.html#socket.socket.connect\" rel=\"noopener noreferrer nofollow\">sock.connect<\/a> \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0430\u0434\u0440\u0435\u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u0435\u0433\u043e \u043f\u043e\u0440\u0442. \u0414\u0430\u043b\u0435\u0435 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 TCP \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 <a href=\"https:\/\/datatracker.ietf.org\/doc\/html\/rfc793#section-3.4\" rel=\"noopener noreferrer nofollow\">\u0442\u0440\u0451\u0445\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0435 \u0440\u0443\u043a\u043e\u043f\u043e\u0436\u0430\u0442\u0438\u0435<\/a> \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0434\u0430\u043b\u0435\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435.<\/p>\n<h2>\u0428\u0430\u0433 \u043f\u044f\u0442\u044b\u0439 &#8212; \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f<\/h2>\n<p>\u0417\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0432 \u0431\u0430\u0439\u0442\u044b \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e \u043a\u0443\u0441\u043a\u0430\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0438 \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0451 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 <a href=\"https:\/\/docs.python.org\/3\/library\/socket.html#socket.socket.sendall\" rel=\"noopener noreferrer nofollow\">sock.sendall(request)<\/a>.<\/p>\n<h2>\u0428\u0430\u0433 \u0448\u0435\u0441\u0442\u043e\u0439 &#8212; \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043e\u0442\u0432\u0435\u0442\u0430<\/h2>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u043d\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0443\u0433\u0430\u0434\u0430\u0442\u044c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0431\u0430\u0439\u0442\u043e\u0432 \u043f\u0440\u0438\u0434\u0435\u0442 \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0442\u043e \u0435\u0441\u0442\u044c \u0434\u043b\u0438\u043d\u043d\u0430 \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0446\u0438\u043a\u043b\u0430 \u0438 <a href=\"https:\/\/docs.python.org\/3\/library\/socket.html#socket.socket.recv\" rel=\"noopener noreferrer nofollow\">socket.recv(size)<\/a> \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442 \u043f\u043e \u043a\u0443\u0441\u043e\u0447\u043a\u0430. \u041f\u0440\u0438\u043c\u0435\u0440\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440\u043e \u043a\u0443\u0441\u043e\u0447\u043a\u043e\u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 4 \u043a\u0431. \u041f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u043d\u0430\u043f\u043e\u043b\u043d\u044f\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 <code>self.response<\/code> \u0434\u0430\u043d\u043d\u044b\u043c\u0438. <\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u0435, \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <code>size=4096<\/code> \u0438 \u044d\u0442\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u043d\u0435 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u0430\u044f \u0446\u0438\u0444\u0440\u0430. <\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u043e \u043e\u043d \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u043f\u0443\u0441\u0442\u043e\u0439 \u0431\u0430\u0439\u0442\u043e\u0432\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 <code>b''<\/code> \u0447\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u043c \u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438.<\/p>\n<h2>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b:<\/h2>\n<h2>\u041a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u0441\u0435 IP \u0430\u0434\u0440\u0435\u0441\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e socket.getaddrinfo?<\/h2>\n<p>\u042d\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e, \u043f\u0435\u0440\u0435\u0434\u0430\u0439\u0442\u0435 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432\u0441\u0435\u0433\u043e \u0434\u0432\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430: <code>host<\/code> \u0438 <code>port<\/code>. \u041a\u0430\u043a \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0438\u0436\u0435:<\/p>\n<pre><code class=\"python\">import socket from pprint import pprint  response = socket.getaddrinfo(host=\"jsonplaceholder.typicode.com\", port=80)  ipv4, ipv6 = set(), set() for address_tuple in response:     address = address_tuple[-1][0]     if \".\" in address:         ipv4.add(address)         continue     ipv6.add(address)  print(\"IPv4\") pprint(ipv4) print() print(\"IPv6\") pprint(ipv6)<\/code><\/pre>\n<h2>\u041a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c IP \u0430\u0434\u0440\u0435\u0441\u0430 \u0431\u0435\u0437 Python?<\/h2>\n<p>\u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f IP \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430 \u0432 Linux \u0441\u0442\u043e\u0438\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0442\u0438\u043b\u0438\u0442\u0443 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Dig_(command)\" rel=\"noopener noreferrer nofollow\">dig<\/a>.\u0422\u0430\u043a \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u043c HTTP GET \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e. \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b. \u041d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u043d <a href=\"https:\/\/datatracker.ietf.org\/doc\/html\/rfc1035\" rel=\"noopener noreferrer nofollow\">DNS-\u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u043c<\/a>.<\/p>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430: <code>dig jsonplaceholder.typicode.com +short<\/code><\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u0432\u043e\u0434\u0430-\u0432\u044b\u0432\u043e\u0434\u0430 (IO). \u041e\u0441\u043e\u0431\u043e\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u0443\u0434\u0435\u043b\u0435\u043d\u043e \u0441\u0435\u0442\u0435\u0432\u043e\u043c\u0443 \u0432\u0432\u043e\u0434\u0443-\u0432\u044b\u0432\u043e\u0434\u0443 (Network IO) \u0438 \u0442\u043e\u043c\u0443, \u043a\u0430\u043a \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u043d\u0438\u0437\u043a\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <code>socket<\/code>. <\/p>\n<p>\u0420\u0430\u0437\u043e\u0431\u0440\u0430\u0432 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u0440\u0443\u0447\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043c\u044b \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043f\u0440\u043e\u0448\u043b\u0438 \u0432\u0441\u0435 \u044d\u0442\u0430\u043f\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f: \u043e\u0442 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f DNS-\u0438\u043c\u0435\u043d\u0438 \u0434\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043e\u0442\u0432\u0435\u0442\u0430 \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430. <\/p>\n<p>\u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0432\u044b\u0441\u043e\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, requests, aiohttp) \u0438 \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 &#171;\u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c&#187; \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0441\u0435\u0442\u044c\u044e.<\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043a\u0430\u0436\u0443\u0442 \u0447\u0442\u043e \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u043e\u043b\u043d\u0430\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u0442\u0443\u0442 \u043d\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u0435\u043c\u0430<\/p>\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-468128","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/468128","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=468128"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/468128\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=468128"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=468128"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=468128"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}