{"id":166463,"date":"2013-01-21T12:58:03","date_gmt":"2013-01-21T08:58:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=166463"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=166463","title":{"rendered":"<span class=\"post_title\">\u041e \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0434\u043b\u044f \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u0432 Python<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u041d\u0430\u0447\u0430\u0442\u044c, \u0432\u0438\u0434\u0438\u043c\u043e, \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0435\u0442 \u043e\u0431 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0435 CPython \u0432\u0435\u0440\u0441\u0438\u0438 2.7.x (\u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u0438\u0441\u044c \u043d\u0430 \u0432\u0435\u0440\u0441\u0438\u0438 2.7.3).<\/p>\n<p>  \u041d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435 \u0438\u043c\u0435\u044e\u0442\u0441\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 import \u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0432 Python:  <\/p>\n<ul>\n<li><a href=\"http:\/\/docs.python.org\/2\/reference\/simple_stmts.html#import\">docs.python.org\/2\/reference\/simple_stmts.html#import<\/a><\/li>\n<li><a href=\"http:\/\/docs.python.org\/2\/tutorial\/modules.html\">docs.python.org\/2\/tutorial\/modules.html<\/a><\/li>\n<\/ul>\n<p>  \u0418\u0437 \u043d\u0438\u0445 \u0441\u043b\u0435\u0434\u0443\u0435\u0442, \u0447\u0442\u043e \u0432 Python \u0438\u043c\u0435\u044e\u0442\u0441\u044f \u043f\u0430\u043a\u0435\u0442\u044b (package), \u043c\u043e\u0434\u0443\u043b\u0438 (module) \u0438 \u0438\u043c\u0435\u043d\u0430, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0432 \u043c\u043e\u0434\u0443\u043b\u044f\u0445 (names). \u0422\u0430\u043a\u0436\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0447\u0430\u0441\u0442\u044f\u0445 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u0434\u043c\u043e\u0443\u0434\u043b\u044f\u043c\u0438 (submodule), \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u044b \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0430\u043a\u0435\u0442\u0430.<\/p>\n<p>  \u0412 \u044f\u0437\u044b\u043a\u0435 Python \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f import \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u043a\u0435\u0442\u044b, \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u0438\u043c\u0435\u043d\u0430 \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0435\u043d, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f import \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f. \u041f\u0440\u0438 \u044d\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0432\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438:  <\/p>\n<ol>\n<li>\u0418\u0437 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 import \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u044f\u0432\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e: \u043f\u0430\u043a\u0435\u0442, \u043c\u043e\u0434\u0443\u043b\u044c \u0438\u043b\u0438 \u0438\u043c\u044f<\/li>\n<li>\u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u043e\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 import \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u0443\u0442\u044c \u043a \u043c\u043e\u0434\u0443\u043b\u044e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u043c \u043f\u0443\u0442\u0435\u043c (\u0445\u043e\u0442\u044f \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u0443\u0442\u044c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043c\u043e\u0436\u043d\u043e, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438, \u0432 \u0447\u0430\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u0433\u043e \u043f\u0443\u0442\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0441\u043c. <a href=\"http:\/\/www.python.org\/dev\/peps\/pep-0328\/\">www.python.org\/dev\/peps\/pep-0328\/<\/a> )<\/li>\n<\/ol>\n<p>  \u0418\u0437 \u044d\u0442\u0438\u0445 \u0434\u0432\u0443\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u0441\u043b\u0435\u0434\u0443\u044e\u0442 \u0442\u0430\u043a\u0438\u0435 \u043d\u0435\u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 import abcd:  <\/p>\n<ol>\n<li>\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u041f\u0410\u041a\u0415\u0422 abcd, \u043b\u0438\u0431\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u041c\u041e\u0414\u0423\u041b\u042c abcd<\/li>\n<li>\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u043a\u0435\u0442\/\u043c\u043e\u0434\u0443\u043b\u044c abcd \u0438\u0437 \u0422\u0415\u041a\u0423\u0429\u0415\u0413\u041e \u041f\u0410\u041a\u0415\u0422\u0410 (\u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 \u0442\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f import abcd), \u043b\u0438\u0431\u043e \u0418\u0417 \u041f\u0410\u041a\u0415\u0422\u0410 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043f\u0435\u0440\u0435\u0447\u043d\u0435\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u0432 sys.path<\/li>\n<\/ol>\n<p>  \u0415\u0449\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043d\u0435\u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e\u0441\u0442\u0435\u0439:  <\/p>\n<ul>\n<li>from abcd import defg: (\u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c defg \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 abcd, \u043b\u0438\u0431\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u043a\u0435\u0442 defg \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 abcd, \u043b\u0438\u0431\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u043c\u044f defg \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 abcd, \u043b\u0438\u0431\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u043c\u044f defg \u0438\u0437 \u043c\u043e\u0434\u0443\u043b\u044f abcd) X (\u0438\u0437 \u0442\u043e\u0433\u043e \u0436\u0435 \u043f\u0430\u043a\u0435\u0442\u0430, \u043b\u0438\u0431\u043e \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 sys.path)<\/li>\n<li>import abcd.defg: (\u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u043a\u0435\u0442 defg \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 abcd, \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c defg \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 abcd) X (\u0438\u0437 \u0442\u043e\u0433\u043e \u0436\u0435 \u043f\u0430\u043a\u0435\u0442\u0430, \u043b\u0438\u0431\u043e \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 sys.path)<\/li>\n<\/ul>\n<p>  \u0414\u043b\u044f \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u0438 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u043d\u0435\u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e\u0441\u0442\u0435\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0438\u043c\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c. \u0422\u0430\u043a\u043e\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u0438\u0434\u0435 \u043e\u043f\u0438\u0441\u0430\u043d \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Python.<br \/>  <a name=\"habracut\"><\/a><\/p>\n<h1>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u043e\u0438\u0441\u043a\u0430 \u0438\u043c\u0435\u043d \u0434\u043b\u044f import abcd<\/h1>\n<p>  \u041f\u043e\u0438\u0441\u043a \u0438\u043c\u0435\u043d\u0438 abcd \u0434\u043b\u044f \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0443:  <\/p>\n<table>\n<tr>\n<th>\u2116<\/th>\n<th>\u0427\u0442\u043e \u0438\u0449\u0435\u043c<\/th>\n<th>\u0413\u0434\u0435 \u0438\u0449\u0435\u043c*<\/th>\n<th>\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439<\/th>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>\u043f\u0430\u043a\u0435\u0442 abcd<\/td>\n<td>\u0432 \u043f\u0430\u043a\u0435\u0442\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f (\u043c\u043e\u0434\u0443\u043b\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f import abcd)<\/td>\n<td>\u0442\u043e\u043b\u044c\u043a\u043e, \u0435\u0441\u043b\u0438 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0441\u0430\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0432 \u043f\u0430\u043a\u0435\u0442\u0435**<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>\u043c\u043e\u0434\u0443\u043b\u044c abcd<\/td>\n<td>\u0432 \u043f\u0430\u043a\u0435\u0442\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f (\u043c\u043e\u0434\u0443\u043b\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f import abcd)<\/td>\n<td>\u0442\u043e\u043b\u044c\u043a\u043e, \u0435\u0441\u043b\u0438 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0441\u0430\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0432 \u043f\u0430\u043a\u0435\u0442\u0435**<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>\u043c\u043e\u0434\u0443\u043b\u044c abcd<\/td>\n<td>\u0432\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 (built-in) \u043c\u043e\u0434\u0443\u043b\u044f\u0445<\/td>\n<td>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u0443\u043a\u0430\u0437\u0430\u043d\u0430 \u0432 ***<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>\u043f\u0430\u043a\u0435\u0442 abcd<\/td>\n<td>\u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430\u0445, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u0432 sys.path<\/td>\n<td>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u0443\u043a\u0430\u0437\u0430\u043d\u0430 \u0432 ****<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td>\u043c\u043e\u0434\u0443\u043b\u044c abcd<\/td>\n<td>\u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430\u0445, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u0432 sys.path<\/td>\n<td>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u0443\u043a\u0430\u0437\u0430\u043d\u0430 \u0432 ****<\/td>\n<\/tr>\n<\/table>\n<p>  \u0414\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0439 \u043f\u043e\u0438\u0441\u043a \u043f\u0440\u0435\u043a\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u0430\u043a\u0435\u0442\u0430 \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0432\u044b\u0448\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0448\u0430\u0433\u043e\u0432.<\/p>\n<p>  * \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0435 \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u0430\u043a\u0435\u0442\u0430 \u043d\u0430\u0434 \u043c\u043e\u0434\u0443\u043b\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430\u044f \u043e\u043f\u044b\u0442\u043d\u044b\u043c \u043f\u0443\u0442\u0435\u043c, \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u044d\u0442\u043e \u044f\u0432\u043d\u043e \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043e.<\/p>\n<p>  ** \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f __package__ \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0440\u0430\u0432\u043d\u0430 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044e \u043f\u0430\u043a\u0435\u0442\u0430, \u0438\u043d\u0430\u0447\u0435 \u043e\u043d\u0430 \u0440\u0430\u0432\u043d\u0430 None.<br \/>  \u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0446\u0438\u044e:<br \/>  <a href=\"http:\/\/docs.python.org\/2\/tutorial\/modules.html#intra-package-references\">docs.python.org\/2\/tutorial\/modules.html#intra-package-references<\/a><br \/>  \u201cIn fact, such references are so common that the import statement first looks in the containing package before looking in the standard module search path.\u201d<\/p>\n<p>  (!!!) \u0417\u0434\u0435\u0441\u044c \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u043a\u0442\u0430 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0442\u043e\u0433\u043e \u0436\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 (http:\/\/docs.python.org\/2\/tutorial\/modules.html#the-module-search-path), \u0447\u0442\u043e \u0432\u0432\u043e\u0434\u0438\u0442 \u0432 \u0437\u0430\u0431\u043b\u0443\u0436\u0434\u0435\u043d\u0438\u0435 (\u0441\u043c. <a href=\"http:\/\/bugs.python.org\/issue16891\">bugs.python.org\/issue16891<\/a>).<\/p>\n<p>  (!!!) \u0412\u0442\u043e\u0440\u043e\u0435, \u0447\u0442\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u2014 \u044d\u0442\u043e \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0439 \u0448\u0430\u0433 \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u044c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f import abcd \u0441\u0430\u043c \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 (\u0442.\u0435. \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 import &lt;\u0438\u043c\u044f \u043f\u0430\u043a\u0435\u0442\u0430&gt;.&lt;\u0438\u043c\u044f \u043c\u043e\u0434\u0443\u043b\u044f&gt;). \u0412 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0431\u0435\u0437 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043f\u0430\u043a\u0435\u0442\u0430, \u043b\u0438\u0431\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u043a\u0430\u043a \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u0448\u0430\u0433 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d. \u042d\u0442\u043e \u043e\u0442\u0440\u0430\u0436\u0435\u043d\u043e \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0435 <a href=\"http:\/\/www.python.org\/dev\/peps\/pep-0302\/#id23\">www.python.org\/dev\/peps\/pep-0302\/#id23<\/a>:<br \/>  \u201cThe built-in __import__ function (known as PyImport_ImportModuleEx() in import.c) will then check to see whether the module doing the import is a package or a submodule of a package. If it is indeed a (submodule of a) package, it first tries to do the import relative to the package (the parent package for a submodule). For example if a package named \u00abspam\u00bb does \u00abimport eggs\u00bb, it will first look for a module named \u00abspam.eggs\u00bb. If that fails, the import continues as an absolute import: it will look for a module named \u00abeggs\u00bb.\u201d<\/p>\n<p>  *** <a href=\"http:\/\/docs.python.org\/2\/tutorial\/modules.html#the-module-search-path\">docs.python.org\/2\/tutorial\/modules.html#the-module-search-path<\/a><br \/>  \u201cWhen a module named spam is imported, the interpreter first searches for a built-in module with that name.\u201d<\/p>\n<p>  **** <a href=\"http:\/\/docs.python.org\/2\/tutorial\/modules.html#the-module-search-path\">docs.python.org\/2\/tutorial\/modules.html#the-module-search-path<\/a><br \/>  \u201cIf not found, it then searches for a file named spam.py in a list of directories given by the variable sys.path.\u201d<\/p>\n<h1>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u043e\u0438\u0441\u043a\u0430 \u0438\u043c\u0435\u043d \u0434\u043b\u044f import abcd.defg<\/h1>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u0438\u0441\u043a \u043f\u0430\u043a\u0435\u0442\u0430 \u0438\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u044f abcd \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c \u0434\u043b\u044f import abcd.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043f\u043e\u0438\u0441\u043a \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0439, \u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0438\u0441\u043a \u043f\u0430\u043a\u0435\u0442\u0430 \u0438\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u044f defg \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c:  <\/p>\n<table>\n<tr>\n<th>\u2116<\/th>\n<th>\u0427\u0442\u043e \u0438\u0449\u0435\u043c<\/th>\n<th>\u0413\u0434\u0435 \u0438\u0449\u0435\u043c*<\/th>\n<th>\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439<\/th>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>\u043f\u0430\u043a\u0435\u0442 defg<\/td>\n<td>\u0432 \u043f\u0430\u043a\u0435\u0442\u0435 abcd<\/td>\n<td>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u0443\u043a\u0430\u0437\u0430\u043d\u0430 \u0432 **<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>\u043c\u043e\u0434\u0443\u043b\u044c defg<\/td>\n<td>\u0432 \u043f\u0430\u043a\u0435\u0442\u0435 abcd<\/td>\n<td>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u0443\u043a\u0430\u0437\u0430\u043d\u0430 \u0432 **<\/td>\n<\/tr>\n<\/table>\n<p>  * \u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u0438\u0441\u043a\u0430 abcd, \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u043c, \u0442\u043e \u0438\u043c\u043f\u043e\u0440\u0442 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u0441\u044f \u043e\u0448\u0438\u0431\u043a\u043e\u0439 ImportError: No module named defg, \u0442.\u043a. \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u0438, \u043b\u0438\u0431\u043e \u043f\u0430\u043a\u0435\u0442\u044b:<br \/>  <a href=\"http:\/\/docs.python.org\/2\/reference\/simple_stmts.html#import\">docs.python.org\/2\/reference\/simple_stmts.html#import<\/a>: \u201cA package can contain other packages and modules while modules cannot contain other modules or packages.\u201d<br \/>  ** <a href=\"http:\/\/www.python.org\/dev\/peps\/pep-0302\/#id23\">www.python.org\/dev\/peps\/pep-0302\/#id23<\/a><br \/>  \u201cDeeper down in the mechanism, a dotted name import is split up by its components. For \u00abimport spam.ham\u00bb, first an \u00abimport spam\u00bb is done, and only when that succeeds is \u00abham\u00bb imported as a submodule of \u00abspam\u00bb.\u201d<\/p>\n<h1>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u043e\u0438\u0441\u043a\u0430 \u0438\u043c\u0435\u043d \u0434\u043b\u044f from abcd.defg import ghi<\/h1>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u0438\u0441\u043a \u043f\u0430\u043a\u0435\u0442\u0430 \u0438\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u044f abcd.defg \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c \u0434\u043b\u044f import abcd.defg:  <\/p>\n<table>\n<tr>\n<th>\u2116<\/th>\n<th>\u0427\u0442\u043e \u0438\u0449\u0435\u043c<\/th>\n<th>\u0413\u0434\u0435 \u0438\u0449\u0435\u043c<\/th>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>\u0438\u043c\u044f ghi<\/td>\n<td>\u0432 \u043f\u0430\u043a\u0435\u0442\u0435 \u0438\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u0435 defg<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>\u043f\u0430\u043a\u0435\u0442 ghi<\/td>\n<td>\u0432 \u043f\u0430\u043a\u0435\u0442\u0435 defg<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>\u043c\u043e\u0434\u0443\u043b\u044c ghi<\/td>\n<td>\u0432 \u043f\u0430\u043a\u0435\u0442\u0435 defg<\/td>\n<\/tr>\n<\/table>\n<p>  <\/p>\n<h1>\u041f\u0435\u0440\u0435\u043a\u0440\u044b\u0442\u0438\u0435 \u0438\u043c\u0435\u043d<\/h1>\n<p>  \u0425\u043e\u0447\u0443 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u043e\u0434\u043d\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0443\u044e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0437 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u044b\u0448\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e: \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u0441 \u0438\u043c\u0435\u043d\u0435\u043c abcd \u0438 \u043f\u0430\u043a\u0435\u0442 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c abcd, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u043c\u043e\u0434\u0443\u043b\u044c defg, \u043c\u043e\u0434\u0443\u043b\u044c abcd \u0438 \u043f\u0430\u043a\u0435\u0442 abcd \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u044b \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430\u0445, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u044c abcd \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d \u0432 \u0442\u043e\u043c \u0436\u0435 \u043f\u0430\u043a\u0435\u0442\u0435, \u0447\u0442\u043e \u0438 \u043c\u043e\u0434\u0443\u043b\u044c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f import abcd.defg. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439. \u042d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440 Python \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0439\u0434\u0435\u0442 \u043c\u043e\u0434\u0443\u043b\u044c abcd, \u043f\u043e\u0442\u043e\u043c \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u0430\u0442\u044c \u0432 \u043d\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c defg, \u0447\u0442\u043e \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e.<\/p>\n<p>  \u0420\u0430\u0437\u0443\u043c\u043d\u0435\u0435 \u0431\u044b\u043b\u043e \u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0438\u0437 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 import, \u0447\u0442\u043e abcd \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u043a\u0435\u0442\u043e\u043c (\u0442.\u043a. \u0432\u0441\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0434\u043e \u0442\u043e\u0447\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u043a\u0435\u0442\u0430\u043c\u0438) \u0438 \u0438\u0441\u043a\u0430\u0442\u044c abcd \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u043a \u043f\u0430\u043a\u0435\u0442. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0430\u043a\u0435\u0442 abcd \u0431\u044b\u043b \u0431\u044b \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u0438\u0437 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430, \u0430 \u0432 \u043d\u0435\u043c \u0431\u044b\u043b \u0431\u044b \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d \u043c\u043e\u0434\u0443\u043b\u044c defg \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043b\u043e\u0441\u044c \u0431\u044b \u0431\u0435\u0437 \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<p>  \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0442\u0430\u043a\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 Python \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e. \u0421\u043c. <a href=\"http:\/\/bugs.python.org\/issue16891#msg179353\">bugs.python.org\/issue16891#msg179353<\/a>.<\/p>\n<p>  \u0410\u0432\u0442\u043e\u0440 \u0441\u0442\u0430\u0442\u044c\u0438 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439, \u043d\u043e \u0432 \u0441\u0432\u044f\u0437\u0438 \u0440\u0430\u0437\u0440\u0430\u0437\u043d\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Python \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u043d\u0435\u043a\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0432\u044b\u044f\u0441\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0447\u0438\u043d \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u044f <a href=\"http:\/\/stackoverflow.com\/questions\/14183541\/why-python-finds-module-instead-of-package-if-they-have-the-same-name\">stackoverflow.com\/questions\/14183541\/why-python-finds-module-instead-of-package-if-they-have-the-same-name<\/a> \u0438 <a href=\"http:\/\/bugs.python.org\/issue16891\">bugs.python.org\/issue16891<\/a>, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f.<\/p>\n<p>  \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043a\u043e\u043b\u043b\u0438\u0437\u0438\u0439 \u0438\u043c\u0435\u043d \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<h1>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435: \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434<\/h1>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434, \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432\u044b\u0448\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b: <a href=\"https:\/\/bitbucket.org\/dmugtasimov\/python_import\">bitbucket.org\/dmugtasimov\/python_import<\/a>. \t\t\t \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/166463\/\"> http:\/\/habrahabr.ru\/post\/166463\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u041d\u0430\u0447\u0430\u0442\u044c, \u0432\u0438\u0434\u0438\u043c\u043e, \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0435\u0442 \u043e\u0431 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0435 CPython \u0432\u0435\u0440\u0441\u0438\u0438 2.7.x (\u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u0438\u0441\u044c \u043d\u0430 \u0432\u0435\u0440\u0441\u0438\u0438 2.7.3).<\/p>\n<p>  \u041d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435 \u0438\u043c\u0435\u044e\u0442\u0441\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 import \u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0432 Python:  <\/p>\n<ul>\n<li><a href=\"http:\/\/docs.python.org\/2\/reference\/simple_stmts.html#import\">docs.python.org\/2\/reference\/simple_stmts.html#import<\/a><\/li>\n<li><a href=\"http:\/\/docs.python.org\/2\/tutorial\/modules.html\">docs.python.org\/2\/tutorial\/modules.html<\/a><\/li>\n<\/ul>\n<p>  \u0418\u0437 \u043d\u0438\u0445 \u0441\u043b\u0435\u0434\u0443\u0435\u0442, \u0447\u0442\u043e \u0432 Python \u0438\u043c\u0435\u044e\u0442\u0441\u044f \u043f\u0430\u043a\u0435\u0442\u044b (package), \u043c\u043e\u0434\u0443\u043b\u0438 (module) \u0438 \u0438\u043c\u0435\u043d\u0430, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0432 \u043c\u043e\u0434\u0443\u043b\u044f\u0445 (names). \u0422\u0430\u043a\u0436\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0447\u0430\u0441\u0442\u044f\u0445 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u0434\u043c\u043e\u0443\u0434\u043b\u044f\u043c\u0438 (submodule), \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u044b \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0430\u043a\u0435\u0442\u0430.<\/p>\n<p>  \u0412 \u044f\u0437\u044b\u043a\u0435 Python \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f import \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u043a\u0435\u0442\u044b, \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u0438\u043c\u0435\u043d\u0430 \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0435\u043d, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f import \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f. \u041f\u0440\u0438 \u044d\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0432\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438:  <\/p>\n<ol>\n<li>\u0418\u0437 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 import \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u044f\u0432\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e: \u043f\u0430\u043a\u0435\u0442, \u043c\u043e\u0434\u0443\u043b\u044c \u0438\u043b\u0438 \u0438\u043c\u044f<\/li>\n<li>\u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u043e\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 import \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u0443\u0442\u044c \u043a \u043c\u043e\u0434\u0443\u043b\u044e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u043c \u043f\u0443\u0442\u0435\u043c (\u0445\u043e\u0442\u044f \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u0443\u0442\u044c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043c\u043e\u0436\u043d\u043e, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438, \u0432 \u0447\u0430\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u0433\u043e \u043f\u0443\u0442\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0441\u043c. <a href=\"http:\/\/www.python.org\/dev\/peps\/pep-0328\/\">www.python.org\/dev\/peps\/pep-0328\/<\/a> )<\/li>\n<\/ol>\n<p>  \u0418\u0437 \u044d\u0442\u0438\u0445 \u0434\u0432\u0443\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u0441\u043b\u0435\u0434\u0443\u044e\u0442 \u0442\u0430\u043a\u0438\u0435 \u043d\u0435\u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 import abcd:  <\/p>\n<ol>\n<li>\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u041f\u0410\u041a\u0415\u0422 abcd, \u043b\u0438\u0431\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u041c\u041e\u0414\u0423\u041b\u042c abcd<\/li>\n<li>\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u043a\u0435\u0442\/\u043c\u043e\u0434\u0443\u043b\u044c abcd \u0438\u0437 \u0422\u0415\u041a\u0423\u0429\u0415\u0413\u041e \u041f\u0410\u041a\u0415\u0422\u0410 (\u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 \u0442\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f import abcd), \u043b\u0438\u0431\u043e \u0418\u0417 \u041f\u0410\u041a\u0415\u0422\u0410 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043f\u0435\u0440\u0435\u0447\u043d\u0435\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u0432 sys.path<\/li>\n<\/ol>\n<p>  \u0415\u0449\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043d\u0435\u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e\u0441\u0442\u0435\u0439:  <\/p>\n<ul>\n<li>from abcd import defg: (\u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c defg \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 abcd, \u043b\u0438\u0431\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u043a\u0435\u0442 defg \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 abcd, \u043b\u0438\u0431\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u043c\u044f defg \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 abcd, \u043b\u0438\u0431\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u043c\u044f defg \u0438\u0437 \u043c\u043e\u0434\u0443\u043b\u044f abcd) X (\u0438\u0437 \u0442\u043e\u0433\u043e \u0436\u0435 \u043f\u0430\u043a\u0435\u0442\u0430, \u043b\u0438\u0431\u043e \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 sys.path)<\/li>\n<li>import abcd.defg: (\u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u043a\u0435\u0442 defg \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 abcd, \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c defg \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 abcd) X (\u0438\u0437 \u0442\u043e\u0433\u043e \u0436\u0435 \u043f\u0430\u043a\u0435\u0442\u0430, \u043b\u0438\u0431\u043e \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 sys.path)<\/li>\n<\/ul>\n<p>  \u0414\u043b\u044f \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u0438 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u043d\u0435\u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e\u0441\u0442\u0435\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0438\u043c\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c. \u0422\u0430\u043a\u043e\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u0438\u0434\u0435 \u043e\u043f\u0438\u0441\u0430\u043d \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Python.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-166463","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/166463","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=166463"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/166463\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=166463"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=166463"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=166463"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}