{"id":274698,"date":"2016-02-21T17:33:02","date_gmt":"2016-02-21T14:33:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=274698"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=274698","title":{"rendered":"\u041f\u0438\u0448\u0435\u043c shell \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043d\u0430 Python \u0438 \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u043c Bash"},"content":{"rendered":"<p>       \u0412 \u044d\u0442\u043e\u0439 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0435\u0442 \u043e \u0442\u043e\u043c, \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u043b\u0435\u0433\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Python \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0432\u043c\u0435\u0441\u0442\u043e Bash\/Sh. \u041f\u0435\u0440\u0432\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u0443 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f, \u043f\u043e\u0436\u0430\u043b\u0443\u0439, \u0430 \u043f\u043e\u0447\u0435\u043c\u0443, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Bash\/Sh, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0431\u044b\u043b\u0438 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u044b? \u0421\u043e\u0437\u0434\u0430\u043d\u044b \u043e\u043d\u0438 \u0431\u044b\u043b\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u0430\u0432\u043d\u043e \u0438, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0438\u043c\u0435\u044e\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441, \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u0445\u043e\u0436\u0438\u0439 \u043d\u0430 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u044f\u0437\u044b\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440 50+ \u043b\u0435\u0432\u0435\u043b\u0430. \u041f\u043e\u043c\u043d\u0438\u0442\u0435, \u043b\u0438 \u0432\u044b \u043d\u0430\u0432\u0441\u043a\u0438\u0434\u043a\u0443 \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 \u043d\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 if?<\/p>\n<pre><code>if [ $# -ne &quot;$ARGCOUNT&quot; ] then     echo &quot;Usage: `basename $0` filename&quot;     exit $E_WRONGARGS fi<\/code><\/pre>\n<p>  \u042d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u043e \u043f\u0440\u0430\u0432\u0434\u0430? \u0418\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441. \ud83d\ude42<\/p>\n<p>  \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0432 python \u044d\u0442\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0449\u0435. \u041a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043a\u043e\u0433\u0434\u0430 \u044f \u043f\u0438\u0448\u0443 \u0447\u0442\u043e \u0442\u043e \u043d\u0430 \u0431\u0430\u0448\u0435, \u0442\u043e \u043d\u0435\u043f\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043b\u0435\u0437\u0443 \u0432 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u0438\u043a \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043a\u0430\u043a \u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 if, switch \u0438\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u0435\u0449\u0435. \u041f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u0438\u0435 \u044f \u0443\u0436\u0435 \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u043b. \ud83d\ude42 \u0412 Python \u0432\u0441\u0435 \u0438\u043d\u0430\u0447\u0435. \u042f \u0445\u043e\u0442\u044c \u0438 \u043d\u0435 \u043f\u0438\u0448\u0443 \u043d\u0430 \u043d\u0435\u043c \u043a\u0440\u0443\u0433\u043b\u044b\u0435 \u0441\u0443\u0442\u043a\u0438, \u043d\u043e \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043b\u0435\u0437\u0442\u044c \u0438 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u0430\u043a \u0442\u0430\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0446\u0438\u043a\u043b, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u044f\u0437\u044b\u043a\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u044b\u0439. \u041f\u043b\u044e\u0441 \u043a\u043e \u0432\u0441\u0435\u043c\u0443 \u043e\u043d \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0431\u043b\u0438\u0436\u0435 \u043a \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u043c\u0435\u0439\u043d\u0441\u0442\u0440\u0438\u043c\u043e\u0432\u044b\u043c \u044f\u0437\u044b\u043a\u0430\u043c \u0442\u0438\u043f\u0430 java \u0438\u043b\u0438 c++, \u0447\u0435\u043c Bash\/Sh.<\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0438 \u043f\u0440\u043e\u0447\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0445 Python \u0435\u0441\u0442\u044c \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0447\u0435\u043c \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u044b. \u0421\u043a\u0430\u0436\u0435\u043c, \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0440\u0430\u0441\u043f\u0430\u0440\u0441\u0438\u0442\u044c json, xml, yaml. \u0417\u043d\u0430\u0435\u0442\u0435 \u043a\u0430\u043a\u043e\u0439 \u044f \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u0432\u0438\u0434\u0435\u043b \u043a\u043e\u0434 \u0432 \u0431\u0430\u0448\u0435 \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e? \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e:<\/p>\n<pre><code>python -c &quot;import json; json.loads...&quot; :)<\/code><\/pre>\n<p>  \u0418 \u044d\u0442\u043e \u0431\u044b\u043b \u043d\u0435 \u043c\u043e\u0439 \u043a\u043e\u0434. \u042d\u0442\u043e \u0431\u044b\u043b \u043a\u043e\u0434 \u0431\u0430\u0448\u0435\/\u043f\u0438\u0442\u043e\u043d\u043e \u043d\u0435\u0439\u0442\u0440\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430.<\/p>\n<p>  \u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0441 \u0440\u0435\u0433\u0435\u043a\u0441\u043e\u043c, sed \u0431\u0435\u0441\u0441\u043f\u043e\u0440\u043d\u043e \u0443\u0434\u043e\u0431\u043d\u0430\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0430, \u043d\u043e \u043a\u0430\u043a \u043c\u043d\u043e\u0433\u043e \u043b\u044e\u0434\u0435\u0439 \u043f\u043e\u043c\u043d\u0438\u0442 \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c? \u041d\u0443 \u043a\u0440\u043e\u043c\u0435 Lee E. McMahon, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u043b. \u0414\u0430 \u0432\u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u043c\u043d\u043e\u0433\u0438\u0435 \u043f\u043e\u043c\u043d\u044f\u0442, \u0434\u0430\u0436\u0435 \u044f \u043f\u043e\u043c\u043d\u044e \u043a\u0430\u043a \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0432\u0435\u0449\u0438. \u041d\u043e, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0432 Python \u043c\u043e\u0434\u0443\u043b\u044c re \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0443\u0434\u043e\u0431\u043d\u0435\u0435.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u0430\u043c \u0434\u0438\u0430\u043b\u0435\u043a\u0442 Python \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <a href=\"https:\/\/github.com\/lamerman\/shellpy\">shellpy<\/a> \u0438 \u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c Bash \u043d\u0430 python \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445. <\/p>\n<p>  \u0412\u0435\u043b\u043a\u0430\u043c \u043f\u043e\u0434 \u043a\u0430\u0442.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>  Shell python \u043d\u0438\u0447\u0435\u043c \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e Python \u043a\u0440\u043e\u043c\u0435 \u043e\u0434\u043d\u043e\u0439 \u0434\u0435\u0442\u0430\u043b\u0438. \u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0438 grave accent \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 ( ` ) \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 Python \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f eval, \u0430 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 \u0448\u0435\u043b\u043b\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440<\/p>\n<pre><code>`ls -l`<\/code><\/pre>\n<p>  \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442 <code>ls -l<\/code> \u043a\u0430\u043a shell \u043a\u043e\u043c\u0430\u043d\u0434\u0443. \u0422\u0430\u043a\u0436\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0441\u0435 \u044d\u0442\u043e \u0431\u0435\u0437 ` \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0440\u043e\u043a\u0438<\/p>\n<pre><code>`ls -l<\/code><\/pre>\n<p>  \u0438 \u044d\u0442\u043e \u0442\u043e\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u043c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u043e\u043c. <\/p>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043c\u0430\u043d\u0434 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0442\u0440\u043e\u043a\u0430\u0445<\/p>\n<pre><code>` echo test &gt; test.txt cat test.txt `<\/code><\/pre>\n<p>  \u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u043e\u043a<\/p>\n<pre><code>`echo This is \\   a very long \\   line<\/code><\/pre>\n<p>  \u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 shellpy \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 Result<\/p>\n<pre><code>result = `ls -l<\/code><\/pre>\n<p>  \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043b\u0438\u0431\u043e <a href=\"https:\/\/github.com\/lamerman\/shellpy\/wiki\/Simple-mode#result\">Result<\/a> \u043b\u0438\u0431\u043e <a href=\"https:\/\/github.com\/lamerman\/shellpy\/wiki\/Interactive-mode#interactive-result\">InteractiveResult<\/a> (\u0421\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431 \u0441 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439, \u043c\u043e\u0436\u043d\u043e \u0438 \u043f\u043e\u0442\u043e\u043c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \ud83d\ude42 ). \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u0447\u043d\u0435\u043c \u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430. \u0418\u0437 \u043d\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b<\/p>\n<pre><code>result = `ls -l print result.returncode<\/code><\/pre>\n<p>  \u0418 \u0442\u0435\u043a\u0441\u0442 \u0438\u0437 stdout \u0438 stderr<\/p>\n<pre><code>result = `ls -l result_text = result.stdout result_error = result.stderr<\/code><\/pre>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0431\u0435\u0436\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u0432\u0441\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0430\u043c stdout \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 \u0446\u0438\u043a\u043b\u0435<\/p>\n<pre><code>result = `ls -l for line in result:     print line.upper()<\/code><\/pre>\n<p>  \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. <\/p>\n<p>  \u0414\u043b\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u0436\u0435 \u0435\u0449\u0435 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u0430\u0445\u0430\u0440\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043b\u0435\u0433\u043a\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u043a\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0440\u0430\u0432\u0435\u043d \u043d\u0443\u043b\u044e<\/p>\n<pre><code>result = `ls -l if result:     print 'Return code for ls -l was 0'<\/code><\/pre>\n<p>  \u0418\u043b\u0438 \u0436\u0435 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u0438\u0437 stdout<\/p>\n<pre><code>result = `ls -l print result<\/code><\/pre>\n<p>  \u0412\u0441\u0435 \u0432\u044b\u0448\u0435\u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0435 \u2014 \u044d\u0442\u043e \u043e\u0431\u0437\u043e\u0440 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u0432\u043a\u0440\u0430\u0442\u0446\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043d\u044f\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0438\u0434\u0435\u044e \u0438 \u043d\u0435 \u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432\u0430\u0441 \u0432\u0441\u0435\u043c\u0438-\u0432\u0441\u0435\u043c\u0438 \u0434\u0435\u0442\u0430\u043b\u044f\u043c\u0438. \u0422\u0430\u043c \u0435\u0441\u0442\u044c \u0435\u0449\u0435 \u043c\u043d\u043e\u0433\u043e \u0447\u0435\u0433\u043e \u0438 \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u043c\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438, \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434. \u041d\u043e \u044d\u0442\u043e \u0432\u0441\u0435 \u0434\u0435\u0442\u0430\u043b\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u043a\u0443\u043d\u0443\u0442\u044c\u0441\u044f \u0432 <a href=\"https:\/\/github.com\/lamerman\/shellpy\/wiki\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a> (\u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435), \u0435\u0441\u043b\u0438 \u0441\u0430\u043c\u0430 \u0438\u0434\u0435\u044f \u0432\u0430\u043c \u043f\u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0439.<\/p>\n<h2>\u042d\u0442\u043e \u0436 \u043d\u0435 \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 Python \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u043a\u0430\u043a \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e?<\/h2>\n<p>  \u041c\u0430\u0433\u0438\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043a\u0430\u043a \u0435\u0449\u0435 \ud83d\ude42 \u0414\u0430, \u0434\u0440\u0443\u0437\u044c\u044f \u043c\u043e\u0438, \u043c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0438\u043d\u0433, \u043a\u0430\u044e\u0441\u044c, \u043d\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u044f \u043d\u0435 \u043d\u0430\u0448\u0435\u043b. \u042f \u0432\u0438\u0434\u0435\u043b \u0434\u0440\u0443\u0433\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u043b\u0430\u044e\u0442 \u043d\u0435\u0447\u0442\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435, \u043d\u0435 \u043d\u0430\u0440\u0443\u0448\u0430\u044f \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u044f\u0437\u044b\u043a\u0430 \u0432\u0440\u043e\u0434\u0435<\/p>\n<pre><code>from sh import ifconfig print(ifconfig(&quot;wlan0&quot;))<\/code><\/pre>\n<p>  \u041d\u043e \u043c\u0435\u043d\u044f \u0442\u0430\u043a\u043e\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043d\u0435 \u0443\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043b, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0434\u0430\u0436\u0435 \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c best user experience &copy;, \u0430 \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442 \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0438 \u0431\u043b\u0438\u0437\u043a\u043e\u0435 \u043a \u0435\u0433\u043e \u0432\u0435\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0428\u0435\u043b\u043b\u0443 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434. <\/p>\n<p>  \u0417\u043d\u0430\u043a\u043e\u043c\u044b\u0439 \u0441 \u0442\u0435\u043c\u043e\u0439 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u0441\u043f\u0440\u043e\u0441\u0438\u0442, \u0447\u0435\u043c IPython \u0442\u043e \u0442\u0435\u0431\u044f \u043d\u0435 \u0443\u0441\u0442\u0440\u043e\u0438\u043b, \u0442\u0430\u043c \u0436 \u043f\u043e\u0447\u0442\u0438 \u043a\u0430\u043a \u0443 \u0442\u0435\u0431\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u043d\u0430\u0447\u043e\u043a \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u0434\u043e, \u043c\u043e\u0436\u0435\u0442 \u0442\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u0438\u0441\u0442, \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043b\u0435\u043d\u044c \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0432 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u0438\u043a? \u0418 \u043f\u0440\u0430\u0432\u0434\u0430 \u043e\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code>lines = !ls -l<\/code><\/pre>\n<p>  \u042f \u0435\u0433\u043e \u043f\u044b\u0442\u0430\u043b\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u043e \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u043b \u043f\u0430\u0440\u0443 \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0443\u0436\u0438\u0442\u044c\u0441\u044f \u043d\u0435 \u0441\u043c\u043e\u0433. \u0421\u0430\u043c\u0430\u044f \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u0438\u0437 \u043d\u0438\u0445, \u0442\u043e \u0447\u0442\u043e \u043d\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u043a\u0430\u043a \u0432 Python. \u0422\u043e \u0435\u0441\u0442\u044c \u0442\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u0448\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043a\u043e\u0434 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c ipython \u0438 \u043b\u0435\u0433\u043a\u043e \u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u0435\u0441\u0442\u0430\u0445. \u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0434\u043b\u044f \u0441\u0432\u043e\u0435\u0433\u043e ipython \u043c\u043e\u0434\u0443\u043b\u044f<\/p>\n<pre><code>import myipythomodule<\/code><\/pre>\n<p>  \u0438 \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435 \u0441\u0440\u0430\u0437\u0443 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u043a\u0430\u043a \u0432 \u0441\u043a\u0430\u0437\u043a\u0435. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442, \u044d\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0435\u0433\u043e. \u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438 \u0443 \u0442\u0435\u0431\u044f \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0432 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u043c \u0444\u0430\u0439\u043b\u0435. \u041d\u0435 \u043a\u043e\u0448\u0435\u0440\u043d\u043e \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434.<\/p>\n<p>  \u0412 shellpy \u043a\u043e\u0434 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043b\u0435\u0433\u043a\u043e \u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a \u0436\u0435 \u043a\u0430\u043a \u0438 \u0432 \u043e\u0431\u044b\u0447\u043d\u043e\u043c python. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c common \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u044b \u0445\u0440\u0430\u043d\u0438\u043c \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u043a\u043e\u0434. \u0417\u0430\u0433\u043b\u044f\u043d\u0435\u043c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0441 \u044d\u0442\u0438\u043c \u043c\u043e\u0434\u0443\u043b\u0435\u043c<\/p>\n<pre><code>ls common\/ common.spy  __init__.spy<\/code><\/pre>\n<p>  \u0418\u0442\u0430\u043a, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0442\u0443\u0442 \u0435\u0441\u0442\u044c, \u043d\u0443 \u0432\u043e \u043f\u0435\u0440\u0432\u044b\u0445 <strong>init<\/strong>, \u043d\u043e \u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c .spy. \u042d\u0442\u043e \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u043b\u0438\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0447\u0435\u0440\u0442\u043e\u0439 spy \u043c\u043e\u0434\u0443\u043b\u044f \u043e\u0442 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0442\u0430\u043a\u0436\u0435 \u0432\u043d\u0443\u0442\u0440\u044c \u0444\u0430\u0439\u043b\u0430 common.spy, \u0447\u0442\u043e \u0442\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e <\/p>\n<pre><code>def common_func():     return `echo 5<\/code><\/pre>\n<p>  \u041c\u044b \u0432\u0438\u0434\u0438\u043c \u0447\u0442\u043e \u0442\u0443\u0442 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0435\u0431\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 shellpy \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0447\u0442\u043e\u0431\u044b \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f `echo 5. \u041a\u0430\u043a \u044d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u0434\u0435? \u0410 \u0432\u043e\u0442 \u043a\u0430\u043a<\/p>\n<pre><code>from common.common import common_func  print('Result of imported function is ' + str(common_func()))<\/code><\/pre>\n<p>  \u0412\u0438\u0434\u0438\u0442\u0435? \u041a\u0430\u043a \u0432 \u043e\u0431\u044b\u0447\u043d\u043e\u043c Python, \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0437\u044f\u043b\u0438 \u0438 \u0437\u0430\u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438.<\/p>\n<p>  \u041a\u0430\u043a \u0436\u0435 \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u042d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/www.python.org\/dev\/peps\/pep-0302\/\">PEP 0302 \u2014 New Import Hooks<\/a>. \u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0435 \u0447\u0442\u043e-\u0442\u043e \u0432 \u0441\u0432\u043e\u0435\u043c \u043a\u043e\u0434\u0435 \u0442\u043e \u0432\u043d\u0430\u0447\u0430\u043b\u0435 Python \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u0443 \u0445\u0443\u043a\u0430, \u043d\u0435\u0442 \u043b\u0438 \u0442\u0443\u0442 \u0447\u0435\u0433\u043e-\u0442\u043e \u0442\u0432\u043e\u0435\u0433\u043e, \u0445\u0443\u043a \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442 PYTHONPATH \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0444\u0430\u0439\u043b\u043e\u0432 *.spy \u0438\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 shellpython. \u0415\u0441\u043b\u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435\u0442, \u0442\u043e \u0442\u0430\u043a \u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u0442: &quot;\u041d\u0438\u0447\u0435\u0433\u043e \u043d\u0435\u0442\u0443, \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0439 \u0441\u0430\u043c&quot;. \u0415\u0441\u043b\u0438 \u0436\u0435 \u043e\u043d \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0447\u0442\u043e-\u0442\u043e \u0442\u0430\u043c, \u0442\u043e \u0445\u0443\u043a \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0438\u043c\u043f\u043e\u0440\u0442\u043e\u043c \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e. \u0410 \u0438\u043c\u0435\u043d\u043d\u043e, \u043e\u043d \u0434\u0435\u043b\u0430\u0435\u0442 \u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0438\u043d\u0433 \u0444\u0430\u0439\u043b\u0430 \u0432 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 python \u0438 \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u044d\u0442\u043e \u0434\u043e\u0431\u0440\u043e \u0432 temp \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0417\u0430\u043f\u0438\u0441\u0430\u0432 \u043d\u043e\u0432\u044b\u0439 Python \u0444\u0430\u0439\u043b \u0438\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u044c \u043e\u043d \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0435\u0433\u043e \u0432 PYTHONPATH \u0438 \u0437\u0430 \u0434\u0435\u043b\u043e \u0431\u0435\u0440\u0435\u0442\u0441\u044f \u0443\u0436\u0435 \u0441\u0430\u043c\u044b\u0439 \u043e\u0431\u044b\u043a\u043d\u043e\u0432\u0435\u043d\u043d\u044b\u0439 \u0438\u043c\u043f\u043e\u0440\u0442.<\/p>\n<h3>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0436\u0435 \u0441\u043a\u043e\u0440\u0435\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u0440\u0438\u043c\u0435\u0440<\/h3>\n<p>  \u042d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0430\u0432\u0430\u0442\u0430\u0440 \u044e\u0437\u0435\u0440\u0430 Python \u0441 Github \u0438 \u043a\u043b\u0430\u0434\u0435\u0442 \u0435\u0433\u043e \u0432 temp \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e<\/p>\n<pre><code class=\"python\">    import json     import os     import tempfile      # \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e curl \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043e\u0442\u0432\u0435\u0442 \u043e\u0442 \u0430\u043f\u0438 \u0433\u0438\u0442\u0445\u0430\u0431\u0430     answer = `curl https:\/\/api.github.com\/users\/python      # \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0430\u0445\u0430\u0440 \u0447\u0442\u043e\u0431\u044b \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441 \u043d\u0443\u043b\u0435\u043c     if answer:         answer_json = json.loads(answer.stdout)         avatar_url = answer_json['avatar_url']          destination = os.path.join(tempfile.gettempdir(), 'python.png')          # \u0432 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0441\u0430\u043c\u0443 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443         result = `curl {avatar_url} &gt; {destination}         if result:             # \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u043e, \u0442\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443              p`ls -l {destination}         else:             print('Failed to download avatar')          print('Avatar downloaded')     else:         print('Failed to access github api')<\/code><\/pre>\n<p>  \u041a\u0440\u0430\u0441\u043e\u0442\u0430&#8230;<\/p>\n<h3>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430<\/h3>\n<p>  Shellpython \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0434\u0432\u0443\u043c\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438: <code>pip install shellpy<\/code> \u0438\u043b\u0438 \u0441\u043a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0432 <a href=\"https:\/\/github.com\/lamerman\/shellpy\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439<\/a> \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432 <code>setup.py install<\/code>. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0443 \u0432\u0430\u0441 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0430 <code>shellpy<\/code>.<\/p>\n<h3>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0436\u0435 \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c<\/h3>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c shellpython \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043f\u0440\u044f\u043c\u043e \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438.<\/p>\n<pre><code>shellpy example\/curl.spy  shellpy example\/git.spy<\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0437\u0434\u0435\u0441\u044c \u0435\u0441\u0442\u044c allinone \u043f\u0440\u0438\u043c\u0435\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0442\u0430\u043a, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u044e\u0442 \u0432\u0441\u0435-\u0432\u0441\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0435\u0441\u0442\u044c \u0432 shellpy. \u0417\u0430\u0433\u043b\u044f\u043d\u0438\u0442\u0435 \u0442\u0443\u0434\u0430, \u0447\u0442\u043e\u0431\u044b \u043b\u0443\u0447\u0448\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u0447\u0442\u043e \u0436\u0435 \u0442\u0430\u043c \u0435\u0449\u0435 \u0442\u0430\u043a\u043e\u0433\u043e \u0435\u0441\u0442\u044c, \u043b\u0438\u0431\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435<\/p>\n<pre><code>shellpy example\/allinone\/test.spy<\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0442\u0440\u0435\u0442\u044c\u0435\u0433\u043e Python \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u043e\u0442 \u0442\u0430\u043a<\/p>\n<pre><code>shellpy example\/allinone\/test3.spy<\/code><\/pre>\n<p>  <\/p>\n<h3>\u0421\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c<\/h3>\n<p>  \u042d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 Linux \u0438 \u0434\u043e\u043b\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430 Mac \u0434\u043b\u044f Python 2.x \u0438 3.x. \u041d\u0430 \u0432\u0438\u043d\u0434\u043e\u0432\u0441\u0435 \u043f\u043e\u043a\u0430 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0435\u0442, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u0441\u0435 \u043f\u0438\u0441\u0430\u043b\u043e\u0441\u044c \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u043e\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u043e\u0433\u043e \u0432 \u043a\u043e\u0434\u0435 \u043d\u0435\u0442. \u041f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0434\u043e\u0448\u043b\u0438 \u0440\u0443\u043a\u0438 \u0435\u0449\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0432\u0438\u043d\u0434\u043e\u0432\u0441\u0435. \u041c\u0430\u043a\u0430 \u0443 \u043c\u0435\u043d\u044f \u0442\u043e\u0436\u0435 \u043d\u0435\u0442, \u043d\u043e \u0432\u0440\u043e\u0434\u0435 \u0443 \u0434\u0440\u0443\u0433\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \ud83d\ude42 \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043c\u0430\u043a \u0438 \u0443 \u0432\u0430\u0441 \u0432\u0441\u0435 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e, \u0441\u043a\u0430\u0436\u0438\u0442\u0435 \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u2014 \u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442, \u043b\u0438\u0431\u043e \u0441\u044e\u0434\u0430 <a href=\"https:\/\/gitter.im\/lamerman\/shellpy?utm_source=badge&amp;amp;utm_medium=badge&amp;amp;utm_campaign=pr-badge&amp;amp;utm_content=badge\"><img decoding=\"async\" src=\"https:\/\/badges.gitter.im\/lamerman\/shellpy.svg\" alt=\"Join the chat at https:\/\/gitter.im\/lamerman\/shellpy\"\/><\/a> \u043b\u0438\u0431\u043e \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u0444\u0438\u0440\u0443\u0439\u0442\u0435 \u043a\u0430\u043a-\u043d\u0438\u0431\u0443\u0434\u044c \ud83d\ude42<\/p>\n<h3>\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f (\u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c)<\/h3>\n<p>  <a href=\"https:\/\/github.com\/lamerman\/shellpy\/wiki\">Wiki<\/a><\/p>\n<h3>\u041c\u043e\u0436\u043d\u043e \u043b\u0438 \u0437\u0430\u043a\u043e\u043d\u0442\u0440\u0438\u0431\u044c\u044e\u0442\u0438\u0442\u044c<\/h3>\n<p>  \u041a\u043e\u043d\u0435\u0447\u043d\u043e \ud83d\ude42<\/p>\n<h3>\u041e\u043d\u043e \u043c\u043d\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0435 \u043d\u0435 \u0440\u0430\u0437\u043b\u043e\u043c\u0430\u0435\u0442?<\/h3>\n<p>  \u0421\u0435\u0439\u0447\u0430\u0441 \u0432\u0435\u0440\u0441\u0438\u044f 0.4.0, \u044d\u0442\u043e \u043d\u0435 \u0441\u0442\u0435\u0439\u0431\u043b \u0438 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u043d \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u043f\u043e\u043a\u0430 \u043b\u0443\u0447\u0448\u0435 \u043d\u0435 \u0437\u0430\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u0441\u043a\u0440\u0438\u043f\u0442, \u043f\u043e\u0434\u043e\u0436\u0434\u0430\u0432 \u043f\u043e\u043a\u0430 \u0432\u0441\u0435 \u043e\u0442\u043b\u0430\u0434\u0438\u0442\u0441\u044f. \u041d\u043e \u0432 \u0434\u0435\u0432\u0435\u043b\u043e\u043f\u043c\u0435\u043d\u0442\u0435, CI \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043f\u043e\u043b\u043d\u0435. \u0412\u0441\u0435 \u044d\u0442\u043e \u043f\u043e\u043a\u0440\u044b\u0442\u043e \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \ud83d\ude42 <a href=\"https:\/\/travis-ci.org\/lamerman\/shellpy\"><img decoding=\"async\" src=\"https:\/\/travis-ci.org\/lamerman\/shellpy.svg?branch=master\" alt=\"Build Status\"\/><\/a><\/p>\n<h3>P.s.<\/h3>\n<p>  \u041f\u0438\u0448\u0438\u0442\u0435 \u0432\u0430\u0448\u0438 \u043e\u0442\u0437\u044b\u0432\u044b \u043e\u0431 \u0438\u0434\u0435\u0435 \u0432 \u0446\u0435\u043b\u043e\u043c \u0438 \u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0445, \u043f\u043e\u0436\u0435\u043b\u0430\u043d\u0438\u044f\u0445, \u0432\u0441\u0435\u0445 \u0440\u0430\u0434 \u0443\u0441\u043b\u044b\u0448\u0430\u0442\u044c \ud83d\ude42 \u0417\u0430\u0432\u043e\u0434\u0438\u0442\u0435 <a href=\"https:\/\/github.com\/lamerman\/shellpy\/issues\">Issues<\/a> \u0435\u0449\u0435 \u0432 \u0433\u0438\u0442\u0445\u0430\u0431\u0435, \u0442\u0430\u043c \u0438\u0445 \u0443\u0436\u0435 \u043c\u043d\u043e\u0433\u043e \ud83d\ude42                 <\/p>\n<div class=\"clear\"><\/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=\"https:\/\/habrahabr.ru\/post\/277679\/\"> https:\/\/habrahabr.ru\/post\/277679\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u0412 \u044d\u0442\u043e\u0439 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0435\u0442 \u043e \u0442\u043e\u043c, \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u043b\u0435\u0433\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Python \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0432\u043c\u0435\u0441\u0442\u043e Bash\/Sh. \u041f\u0435\u0440\u0432\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u0443 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f, \u043f\u043e\u0436\u0430\u043b\u0443\u0439, \u0430 \u043f\u043e\u0447\u0435\u043c\u0443, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Bash\/Sh, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0431\u044b\u043b\u0438 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u044b? \u0421\u043e\u0437\u0434\u0430\u043d\u044b \u043e\u043d\u0438 \u0431\u044b\u043b\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u0430\u0432\u043d\u043e \u0438, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0438\u043c\u0435\u044e\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441, \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u0445\u043e\u0436\u0438\u0439 \u043d\u0430 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u044f\u0437\u044b\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440 50+ \u043b\u0435\u0432\u0435\u043b\u0430. \u041f\u043e\u043c\u043d\u0438\u0442\u0435, \u043b\u0438 \u0432\u044b \u043d\u0430\u0432\u0441\u043a\u0438\u0434\u043a\u0443 \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 \u043d\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 if?<\/p>\n<pre><code>if [ $# -ne &quot;$ARGCOUNT&quot; ] then     echo &quot;Usage: `basename $0` filename&quot;     exit $E_WRONGARGS fi<\/code><\/pre>\n<p>  \u042d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u043e \u043f\u0440\u0430\u0432\u0434\u0430? \u0418\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441. \ud83d\ude42<\/p>\n<p>  \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0432 python \u044d\u0442\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0449\u0435. \u041a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043a\u043e\u0433\u0434\u0430 \u044f \u043f\u0438\u0448\u0443 \u0447\u0442\u043e \u0442\u043e \u043d\u0430 \u0431\u0430\u0448\u0435, \u0442\u043e \u043d\u0435\u043f\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043b\u0435\u0437\u0443 \u0432 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u0438\u043a \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043a\u0430\u043a \u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 if, switch \u0438\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u0435\u0449\u0435. \u041f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u0438\u0435 \u044f \u0443\u0436\u0435 \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u043b. \ud83d\ude42 \u0412 Python \u0432\u0441\u0435 \u0438\u043d\u0430\u0447\u0435. \u042f \u0445\u043e\u0442\u044c \u0438 \u043d\u0435 \u043f\u0438\u0448\u0443 \u043d\u0430 \u043d\u0435\u043c \u043a\u0440\u0443\u0433\u043b\u044b\u0435 \u0441\u0443\u0442\u043a\u0438, \u043d\u043e \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043b\u0435\u0437\u0442\u044c \u0438 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u0430\u043a \u0442\u0430\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0446\u0438\u043a\u043b, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u044f\u0437\u044b\u043a\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u044b\u0439. \u041f\u043b\u044e\u0441 \u043a\u043e \u0432\u0441\u0435\u043c\u0443 \u043e\u043d \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0431\u043b\u0438\u0436\u0435 \u043a \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u043c\u0435\u0439\u043d\u0441\u0442\u0440\u0438\u043c\u043e\u0432\u044b\u043c \u044f\u0437\u044b\u043a\u0430\u043c \u0442\u0438\u043f\u0430 java \u0438\u043b\u0438 c++, \u0447\u0435\u043c Bash\/Sh.<\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0438 \u043f\u0440\u043e\u0447\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0445 Python \u0435\u0441\u0442\u044c \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0447\u0435\u043c \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u044b. \u0421\u043a\u0430\u0436\u0435\u043c, \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0440\u0430\u0441\u043f\u0430\u0440\u0441\u0438\u0442\u044c json, xml, yaml. \u0417\u043d\u0430\u0435\u0442\u0435 \u043a\u0430\u043a\u043e\u0439 \u044f \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u0432\u0438\u0434\u0435\u043b \u043a\u043e\u0434 \u0432 \u0431\u0430\u0448\u0435 \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e? \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e:<\/p>\n<pre><code>python -c &quot;import json; json.loads...&quot; :)<\/code><\/pre>\n<p>  \u0418 \u044d\u0442\u043e \u0431\u044b\u043b \u043d\u0435 \u043c\u043e\u0439 \u043a\u043e\u0434. \u042d\u0442\u043e \u0431\u044b\u043b \u043a\u043e\u0434 \u0431\u0430\u0448\u0435\/\u043f\u0438\u0442\u043e\u043d\u043e \u043d\u0435\u0439\u0442\u0440\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430.<\/p>\n<p>  \u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0441 \u0440\u0435\u0433\u0435\u043a\u0441\u043e\u043c, sed \u0431\u0435\u0441\u0441\u043f\u043e\u0440\u043d\u043e \u0443\u0434\u043e\u0431\u043d\u0430\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0430, \u043d\u043e \u043a\u0430\u043a \u043c\u043d\u043e\u0433\u043e \u043b\u044e\u0434\u0435\u0439 \u043f\u043e\u043c\u043d\u0438\u0442 \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c? \u041d\u0443 \u043a\u0440\u043e\u043c\u0435 Lee E. McMahon, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u043b. \u0414\u0430 \u0432\u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u043c\u043d\u043e\u0433\u0438\u0435 \u043f\u043e\u043c\u043d\u044f\u0442, \u0434\u0430\u0436\u0435 \u044f \u043f\u043e\u043c\u043d\u044e \u043a\u0430\u043a \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0432\u0435\u0449\u0438. \u041d\u043e, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0432 Python \u043c\u043e\u0434\u0443\u043b\u044c re \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0443\u0434\u043e\u0431\u043d\u0435\u0435.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u0430\u043c \u0434\u0438\u0430\u043b\u0435\u043a\u0442 Python \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <a href=\"https:\/\/github.com\/lamerman\/shellpy\">shellpy<\/a> \u0438 \u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c Bash \u043d\u0430 python \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445. <\/p>\n<p>  \u0412\u0435\u043b\u043a\u0430\u043c \u043f\u043e\u0434 \u043a\u0430\u0442.  <\/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-274698","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/274698","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=274698"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/274698\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=274698"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=274698"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=274698"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}