{"id":336903,"date":"2022-08-11T15:00:22","date_gmt":"2022-08-11T15:00:22","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=336903"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=336903","title":{"rendered":"<span>Python WebAssembly PyScript \u0438 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0432\u0435\u0431\u0441\u0430\u0439\u0442\u0430 \u043d\u0430 Azure Static \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e visual studio code<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442<\/p>\n<p> \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 .py \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u0435\u0433\u043e \u0432 Azure.<\/p>\n<p>\u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f: \u0443\u0447\u0435\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c Azure + \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0443\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u043e\u0435 \u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c.  \u0422\u0430\u043a\u0436\u0435 \u043d\u0443\u0436\u0435\u043d VSCode (\u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0430\u044f IDE).<\/p>\n<p> \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043c, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/032\/f4b\/681\/032f4b6817e3ca22118447171179ad0b.png\" width=\"678\" height=\"704\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/032\/f4b\/681\/032f4b6817e3ca22118447171179ad0b.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0427\u0442\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c?<\/p>\n<ul>\n<li>\n<p>\u041e\u0431\u0449\u0438\u0435 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e WebAssembly (WASM) <\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u0449\u0438\u0435 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0441\u0430\u0439\u0442\u0430 \u0432 Azure<\/p>\n<\/li>\n<\/ul>\n<p> \u0418\u0442\u0430\u043a, \u043d\u0430\u0447\u043d\u0435\u043c<\/p>\n<p>WebAssembly (WASM) \u2014 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/en.wikipedia.org\/wiki\/WebAssembly\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a> \u0438\u043b\u0438 <a href=\"https:\/\/webassembly.org\/\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>, \u043d\u043e \u0432\u043a\u0440\u0430\u0442\u0446\u0435 \u2014 \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (Python, Golang, C# \u0438 \u0442. \u0434.) \u043f\u0440\u044f\u043c\u043e \u0432 HTML-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443.<\/p>\n<p>\u041f\u0440\u043e\u0441\u0442\u0430\u044f HTML-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"xml\">&lt;!DOCTYPE html> &lt;html> &lt;head> &lt;title>PyScript Example&lt;\/title> &lt;\/head> &lt;body> &lt;p>This is a PyScript example.&lt;\/p> &lt;\/body> &lt;\/html><\/code><\/pre>\n<p>\u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u043a\u043e\u0434 Python, \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0449\u0438\u0439 \u0433\u0440\u0430\u0444\u0438\u043a, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"python\">import matplotlib.pyplot as plt import numpy as npx = np.random.randn(n) y = np.random.randn(n) x, y = make_x_and_y(n = 1000) fig, ax = plt.subplots() ax.scatter(x, y) fig<\/code><\/pre>\n<p>\u041a\u0442\u043e \u043d\u0435 \u0437\u043d\u0430\u043a\u043e\u043c \u0441 \u044d\u0442\u0438\u043c \u044f\u0437\u044b\u043a\u043e\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043e \u043d\u0435\u043c, \u043d\u043e \u0445\u043e\u0442\u044f \u0431\u044b \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e \u043e\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0438\u043d\u0430\u0447\u0435.  \u042f \u043d\u0430\u0434\u0435\u044e\u0441\u044c \ud83d\ude42<\/p>\n<p>\u0418\u0442\u0430\u043a, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u043c: HTML \u0438 Python!<\/p>\n<p>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 VSCode.<\/p>\n<p>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f (\u0438\u043b\u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 Ctrl Shift X).<\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f: Live Server, AzureStorage.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b (\u0438\u043b\u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 Ctrl N).<\/p>\n<p>\u0412\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0442\u0435\u043a\u0441\u0442:<\/p>\n<pre><code class=\"xml\">&lt;!DOCTYPE html> &lt;html lang=\u201deng\u201d> &lt;head> &lt;title>PyScript Example&lt;\/title> &lt;link rel=\u201dstylesheet\u201d  ref=\u201dhttps:\/\/pyscript.net\/alpha\/pyscript.css\" \/> &lt;script defer src=\u201dhttps:\/\/pyscript.net\/alpha\/pyscript.js\">&lt;\/script> &lt;link  ref=\u201dhttps:\/\/cdn.jsdelivr.net\/npm\/bootstrap@5.1.3\/dist\/css\/bootstrap min.css\" rel=\u201dstylesheet\u201d crossorigin=\u201danonymous\u201d> &lt;py-env> - numpy - matplotlib &lt;\/py-env> &lt;\/head> &lt;body> &lt;h5>PyScript Tests&lt;\/h5> &lt;py-script ouput = \u201cplot\u201d> import matplotlib.pyplot as plt import numpy as np x = np.random.randn(1000) y = np.random.randn(1000) fig, ax = plt.subplots() ax.scatter(x, y) fig &lt;\/py-script> &lt;h1> Pyscript REPL&lt;\/h1> &lt;br> &lt;h5>Click \u2018Shift Enter\u2019 after line&lt;\/h5> &lt;div> &lt;py-repl id=\u201dmy-repl\u201d auto-generate=\u201dtrue\u201d>&lt;\/py-repl> &lt;\/div> &lt;\/body> &lt;\/html><\/code><\/pre>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0435\u0433\u043e \u043a\u0430\u043a html-\u0444\u0430\u0439\u043b. <\/p>\n<p>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 Command Palette (\u0438\u043b\u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 Ctrl Shift P). <\/p>\n<p>\u041d\u0430\u043f\u0438\u0448\u0438\u0442\u0435: &#171;Open With Live Server&#187; <\/p>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0430 \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430, \u043a\u0430\u043a \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e \u043d\u0430 \u0432\u0435\u0440\u0445\u043d\u0435\u0439 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u0432\u0441\u0435 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u044d\u0442\u0443 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0432 Azure. \u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u044d\u0442\u0443 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0438\u0437 \u043b\u044e\u0431\u043e\u0433\u043e \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0439. <\/p>\n<p>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435\u00a0Azure<\/p>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043a Azure storage account<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/08c\/2f2\/4f7\/08c2f24f707803d43f52e68c1e60d65b.png\" width=\"104\" height=\"109\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/08c\/2f2\/4f7\/08c2f24f707803d43f52e68c1e60d65b.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0429\u0435\u043b\u043a\u043d\u0438\u0442\u0435 \u0421\u043e\u0437\u0434\u0430\u0442\u044c.  <\/p>\n<p>\u0417\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0432\u0441\u0435 \u043f\u043e\u043b\u044f.  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0442\u044c. <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u0430\u0436\u043c\u0438\u0442\u0435 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0443\u044e \u0443\u0447\u0435\u0442\u043d\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f. <\/p>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043d\u0430 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0432\u0435\u0431-\u0441\u0430\u0439\u0442:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c8b\/3ba\/10d\/c8b3ba10da68c5db042c5e90fa161c7d.png\" width=\"268\" height=\"495\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c8b\/3ba\/10d\/c8b3ba10da68c5db042c5e90fa161c7d.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0430\u0436\u043c\u0438\u0442\u0435 enable \u0438 save<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6ba\/1fd\/a71\/6ba1fda7166dc9ebe78518c754959703.png\" width=\"705\" height=\"333\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6ba\/1fd\/a71\/6ba1fda7166dc9ebe78518c754959703.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u0432 VSCode<\/p>\n<p>\u041d\u0430\u0436\u043c\u0435\u043c \u043d\u0430 \u043f\u0430\u043f\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0432\u044b\u0431\u0435\u0440\u0435\u043c \u201cDeploy to Static Website via Azure Storage\u201d:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0db\/5bf\/35e\/0db5bf35e1b63a7b317c751120cc53e9.png\" alt=\"\u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u043c\u0435\u043d\u044e \u043d\u0435 \u043e\u0442\u043a\u0440\u044b\u043b\u043e\u0441\u044c, \u0432 VSCode \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u043f\u0430\u043f\u043a\u0443 \u0432\u044b\u0448\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u0445\u043e\u0434\u0438\u0442 \u043f\u0430\u043f\u043a\u0430 \u043d\u0430\u0448\u0435\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b.\" title=\"\u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u043c\u0435\u043d\u044e \u043d\u0435 \u043e\u0442\u043a\u0440\u044b\u043b\u043e\u0441\u044c, \u0432 VSCode \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u043f\u0430\u043f\u043a\u0443 \u0432\u044b\u0448\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u0445\u043e\u0434\u0438\u0442 \u043f\u0430\u043f\u043a\u0430 \u043d\u0430\u0448\u0435\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b.\" width=\"351\" height=\"495\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0db\/5bf\/35e\/0db5bf35e1b63a7b317c751120cc53e9.png\"\/><figcaption>\u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u043c\u0435\u043d\u044e \u043d\u0435 \u043e\u0442\u043a\u0440\u044b\u043b\u043e\u0441\u044c, \u0432 VSCode \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u043f\u0430\u043f\u043a\u0443 \u0432\u044b\u0448\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u0445\u043e\u0434\u0438\u0442 \u043f\u0430\u043f\u043a\u0430 \u043d\u0430\u0448\u0435\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b.<\/figcaption><\/figure>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u043c \u043e\u043a\u043d\u0435 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 Azure storage account, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0443\u044e \u0440\u0430\u043d\u0435\u0435.<\/p>\n<p>\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443. <\/p>\n<p>\u0412 \u043a\u043e\u043d\u0446\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0443\u0447\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f Azure, \u0447\u0442\u043e\u0431\u044b \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u0434\u0435\u043d\u044c\u0433\u0438.<\/p>\n<p>\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 <a href=\"https:\/\/github.com\/zzfima\/PyScript\" rel=\"noopener noreferrer nofollow\">\u0440\u0435\u043f\u043e<\/a> <\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/682050\/\"> https:\/\/habr.com\/ru\/post\/682050\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442<\/p>\n<p> \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 .py \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u0435\u0433\u043e \u0432 Azure.<\/p>\n<p>\u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f: \u0443\u0447\u0435\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c Azure + \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0443\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u043e\u0435 \u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c.  \u0422\u0430\u043a\u0436\u0435 \u043d\u0443\u0436\u0435\u043d VSCode (\u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0430\u044f IDE).<\/p>\n<p> \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043c, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0427\u0442\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c?<\/p>\n<ul>\n<li>\n<p>\u041e\u0431\u0449\u0438\u0435 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e WebAssembly (WASM) <\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u0449\u0438\u0435 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0441\u0430\u0439\u0442\u0430 \u0432 Azure<\/p>\n<\/li>\n<\/ul>\n<p> \u0418\u0442\u0430\u043a, \u043d\u0430\u0447\u043d\u0435\u043c<\/p>\n<p>WebAssembly (WASM) \u2014 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/en.wikipedia.org\/wiki\/WebAssembly\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a> \u0438\u043b\u0438 <a href=\"https:\/\/webassembly.org\/\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>, \u043d\u043e \u0432\u043a\u0440\u0430\u0442\u0446\u0435 \u2014 \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (Python, Golang, C# \u0438 \u0442. \u0434.) \u043f\u0440\u044f\u043c\u043e \u0432 HTML-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443.<\/p>\n<p>\u041f\u0440\u043e\u0441\u0442\u0430\u044f HTML-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"xml\">&lt;!DOCTYPE html> &lt;html> &lt;head> &lt;title>PyScript Example&lt;\/title> &lt;\/head> &lt;body> &lt;p>This is a PyScript example.&lt;\/p> &lt;\/body> &lt;\/html><\/code><\/pre>\n<p>\u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u043a\u043e\u0434 Python, \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0449\u0438\u0439 \u0433\u0440\u0430\u0444\u0438\u043a, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"python\">import matplotlib.pyplot as plt import numpy as npx = np.random.randn(n) y = np.random.randn(n) x, y = make_x_and_y(n = 1000) fig, ax = plt.subplots() ax.scatter(x, y) fig<\/code><\/pre>\n<p>\u041a\u0442\u043e \u043d\u0435 \u0437\u043d\u0430\u043a\u043e\u043c \u0441 \u044d\u0442\u0438\u043c \u044f\u0437\u044b\u043a\u043e\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043e \u043d\u0435\u043c, \u043d\u043e \u0445\u043e\u0442\u044f \u0431\u044b \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e \u043e\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0438\u043d\u0430\u0447\u0435.  \u042f \u043d\u0430\u0434\u0435\u044e\u0441\u044c \ud83d\ude42<\/p>\n<p>\u0418\u0442\u0430\u043a, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u043c: HTML \u0438 Python!<\/p>\n<p>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 VSCode.<\/p>\n<p>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f (\u0438\u043b\u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 Ctrl Shift X).<\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f: Live Server, AzureStorage.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b (\u0438\u043b\u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 Ctrl N).<\/p>\n<p>\u0412\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0442\u0435\u043a\u0441\u0442:<\/p>\n<pre><code class=\"xml\">&lt;!DOCTYPE html> &lt;html lang=\u201deng\u201d> &lt;head> &lt;title>PyScript Example&lt;\/title> &lt;link rel=\u201dstylesheet\u201d  ref=\u201dhttps:\/\/pyscript.net\/alpha\/pyscript.css\" \/> &lt;script defer src=\u201dhttps:\/\/pyscript.net\/alpha\/pyscript.js\">&lt;\/script> &lt;link  ref=\u201dhttps:\/\/cdn.jsdelivr.net\/npm\/bootstrap@5.1.3\/dist\/css\/bootstrap min.css\" rel=\u201dstylesheet\u201d crossorigin=\u201danonymous\u201d> &lt;py-env> - numpy - matplotlib &lt;\/py-env> &lt;\/head> &lt;body> &lt;h5>PyScript Tests&lt;\/h5> &lt;py-script ouput = \u201cplot\u201d> import matplotlib.pyplot as plt import numpy as np x = np.random.randn(1000) y = np.random.randn(1000) fig, ax = plt.subplots() ax.scatter(x, y) fig &lt;\/py-script> &lt;h1> Pyscript REPL&lt;\/h1> &lt;br> &lt;h5>Click \u2018Shift Enter\u2019 after line&lt;\/h5> &lt;div> &lt;py-repl id=\u201dmy-repl\u201d auto-generate=\u201dtrue\u201d>&lt;\/py-repl> &lt;\/div> &lt;\/body> &lt;\/html><\/code><\/pre>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0435\u0433\u043e \u043a\u0430\u043a html-\u0444\u0430\u0439\u043b. <\/p>\n<p>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 Command Palette (\u0438\u043b\u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 Ctrl Shift P). <\/p>\n<p>\u041d\u0430\u043f\u0438\u0448\u0438\u0442\u0435: &#171;Open With Live Server&#187; <\/p>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0430 \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430, \u043a\u0430\u043a \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e \u043d\u0430 \u0432\u0435\u0440\u0445\u043d\u0435\u0439 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u0432\u0441\u0435 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u044d\u0442\u0443 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0432 Azure. \u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u044d\u0442\u0443 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0438\u0437 \u043b\u044e\u0431\u043e\u0433\u043e \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0439. <\/p>\n<p>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435\u00a0Azure<\/p>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043a Azure storage account<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0429\u0435\u043b\u043a\u043d\u0438\u0442\u0435 \u0421\u043e\u0437\u0434\u0430\u0442\u044c.  <\/p>\n<p>\u0417\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0432\u0441\u0435 \u043f\u043e\u043b\u044f.  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0442\u044c. <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u0430\u0436\u043c\u0438\u0442\u0435 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0443\u044e \u0443\u0447\u0435\u0442\u043d\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f. <\/p>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043d\u0430 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0432\u0435\u0431-\u0441\u0430\u0439\u0442:<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0430\u0436\u043c\u0438\u0442\u0435 enable \u0438 save<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u0432 VSCode<\/p>\n<p>\u041d\u0430\u0436\u043c\u0435\u043c \u043d\u0430 \u043f\u0430\u043f\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0432\u044b\u0431\u0435\u0440\u0435\u043c \u201cDeploy to Static Website via Azure Storage\u201d:<\/p>\n<figure class=\"\"><figcaption>\u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u043c\u0435\u043d\u044e \u043d\u0435 \u043e\u0442\u043a\u0440\u044b\u043b\u043e\u0441\u044c, \u0432 VSCode \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u043f\u0430\u043f\u043a\u0443 \u0432\u044b\u0448\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u0445\u043e\u0434\u0438\u0442 \u043f\u0430\u043f\u043a\u0430 \u043d\u0430\u0448\u0435\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b.<\/figcaption><\/figure>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u043c \u043e\u043a\u043d\u0435 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 Azure storage account, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0443\u044e \u0440\u0430\u043d\u0435\u0435.<\/p>\n<p>\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443. <\/p>\n<p>\u0412 \u043a\u043e\u043d\u0446\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0443\u0447\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f Azure, \u0447\u0442\u043e\u0431\u044b \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u0434\u0435\u043d\u044c\u0433\u0438.<\/p>\n<p>\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 <a href=\"https:\/\/github.com\/zzfima\/PyScript\" rel=\"noopener noreferrer nofollow\">\u0440\u0435\u043f\u043e<\/a> <\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/682050\/\"> https:\/\/habr.com\/ru\/post\/682050\/<\/a><br \/><\/br><\/br><\/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-336903","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/336903","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=336903"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/336903\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=336903"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=336903"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=336903"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}