-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathindex.html
More file actions
320 lines (270 loc) · 19.5 KB
/
Copy pathindex.html
File metadata and controls
320 lines (270 loc) · 19.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>PyScript | Run Python in your HTML</title>
<meta name="description" content="PyScript">
<meta name="author" content="Anaconda Inc.">
<meta property="og:title" content="Pyscript.net">
<meta property="og:type" content="website">
<meta property="og:description" content="Run Python code in your HTML.">
<meta property="og:image" content="assets/images/pyscript-preview.png">
<!--
<link rel="icon" href="/favicon.ico">
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
-->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="assets/css/main.css?v=1.2">
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-LKETQQ110J"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'G-LKETQQ110J');
</script>
</head>
<body>
<main class="main">
<!-- begin header -->
<header class="site-header">
<div class="logo">
<img src="assets/images/pyscript-sticker-black.svg">
<strong class="subhead">Run Python in Your HTML</strong>
</div>
</header>
<!-- end header -->
<section class="content">
<!-- begin terminal window -->
<div class="terminal">
<div class="menu">
<div class="window-buttons close"></div>
<div class="window-buttons minimize"></div>
<div class="window-buttons zoom"></div>
</div>
<div class="screen">
<div class="code">
<pre id="typewriter">
Wouldn't it be cool...
to run Python...
in your browser?
</pre>
<p class="line1"><html><span class="cursor1">|</span></p>
<p class="line2"> ...<span class="cursor2">|</span></p>
<p class="line3"> <py-script><span style="color: #aaa;"> <span style="color:#FFD580;">print</span>(<span style="color:#BAE67E;">'Now you can!'</span>) </span></py-script><span class="cursor3">|</span></p>
<p class="line4"></html><span class="cursor4">|</span></p>
<p class="line5"><span class="cursor5">|</span></p>
</div>
</div>
</div>
<!-- end terminal window -->
<!-- begin dialog content -->
<div class="dialogs">
<div class="dialog dropdown" tabindex="1">
<div class="glyph">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 330 330" style="enable-background:new 0 0 330 330;" xml:space="preserve">
<g id="XMLID_23_">
<path id="XMLID_24_" d="M154.389,255.602c0.351,0.351,0.719,0.683,1.103,0.998c0.169,0.138,0.347,0.258,0.52,0.388
c0.218,0.164,0.432,0.333,0.659,0.484c0.212,0.142,0.432,0.265,0.649,0.395c0.202,0.121,0.4,0.248,0.608,0.359
c0.223,0.12,0.453,0.221,0.681,0.328c0.215,0.102,0.427,0.21,0.648,0.301c0.223,0.092,0.45,0.167,0.676,0.247
c0.236,0.085,0.468,0.175,0.709,0.248c0.226,0.068,0.456,0.119,0.684,0.176c0.246,0.062,0.489,0.131,0.739,0.181
c0.263,0.052,0.529,0.083,0.794,0.121c0.219,0.031,0.435,0.073,0.658,0.095c0.492,0.048,0.986,0.075,1.48,0.075
c0.494,0,0.988-0.026,1.479-0.075c0.226-0.022,0.444-0.064,0.667-0.096c0.262-0.037,0.524-0.068,0.784-0.12
c0.255-0.05,0.504-0.121,0.754-0.184c0.223-0.057,0.448-0.105,0.669-0.172c0.246-0.075,0.483-0.167,0.724-0.253
c0.221-0.08,0.444-0.152,0.662-0.242c0.225-0.093,0.44-0.202,0.659-0.306c0.225-0.106,0.452-0.206,0.672-0.324
c0.21-0.112,0.408-0.239,0.611-0.361c0.217-0.13,0.437-0.252,0.648-0.394c0.222-0.148,0.431-0.314,0.644-0.473
c0.179-0.134,0.362-0.258,0.536-0.4c0.365-0.3,0.714-0.617,1.049-0.949c0.016-0.016,0.034-0.028,0.049-0.044l70.002-69.998
c5.858-5.858,5.858-15.355,0-21.213c-5.857-5.857-15.355-5.858-21.213-0.001l-44.396,44.393V25c0-8.284-6.716-15-15-15
c-8.284,0-15,6.716-15,15v183.785l-44.392-44.391c-5.857-5.858-15.355-5.858-21.213,0c-5.858,5.858-5.858,15.355,0,21.213
L154.389,255.602z"/>
<path id="XMLID_25_" d="M315,160c-8.284,0-15,6.716-15,15v115H30V175c0-8.284-6.716-15-15-15c-8.284,0-15,6.716-15,15v130
c0,8.284,6.716,15,15,15h300c8.284,0,15-6.716,15-15V175C330,166.716,323.284,160,315,160z"/>
</g>
</svg>
</div>
<div>
<h2>Download</h2>
<p>Get started with PyScript</p>
</div>
<div class="dropdown-content">
<i class="close" tabindex="1"></i>
<div class="inner">
<ol>
<li>
<a href="https://github.com/pyscript/pyscript/archive/refs/heads/main.zip" class="file-download">
<div class="flex">
<div>
<svg width="24px" height="24px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path fill="none" stroke="#2C2E34" stroke-width="2" d="M4.99787498,8.99999999 L4.99787498,0.999999992 L19.4999998,0.999999992 L22.9999998,4.50000005 L23,23 L4,23 M18,1 L18,6 L23,6 M2,13 L7,13 L7,14 L3,18 L3,19 L8,19 M11,12 L11,20 L11,12 Z M15,13 L15,20 L15,13 Z M20,15 C20,13.895 19.105,13 18,13 L15,13 L15,17 L18,17 C19.105,17 20,16.105 20,15 Z"/>
</svg>
</div>
<strong>Download PyScript now</strong>.
</div>
</a>
</li>
<li>Unzip the downloaded file.</li>
<li>Copy the assets you want to use and add the following lines to your html file:</li>
</ol>
<code class="pre">
<link rel="stylesheet" href="path/to/pyscript.css" /><br>
<script defer src="path/to/pyscript.js"></script>
</code>
</div>
</div>
</div>
<div class="dialog dropdown" tabindex="2">
<div class="glyph">
<svg width="24px" height="24px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path fill="none" stroke="#fff" stroke-width="2" d="M9,22 L15,2 M17,17 L22,12 L17,7 M7,17 L2,12 L7,7"/>
</svg>
</div>
<div>
<h2>Install</h2>
<p>Click here for instructions</p>
</div>
<div class="dropdown-content">
<i class="close" tabindex="2"></i>
<div class="inner">
<p style="font-size:1.15rem;padding-bottom: 0;">Just kidding, you don't need to install anything. 😃 </p>
<p>To use PyScript you can either <a href="https://github.com/pyscript/pyscript/archive/refs/heads/main.zip">download</a> it and follow the instructions, or add the following lines to your page.</p>
<code class="pre">
<link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" /><br>
<script defer src="https://pyscript.net/alpha/pyscript.js"></script>
</code>
<p>Click <a href="https://github.com/pyscript/pyscript/blob/main/GETTING-STARTED.md" target="_blank">here</a> for more info on how to use PyScript.</p>
</div>
</div>
</div>
</div>
<!-- end dialog content -->
<p class="disclaimer">Please be advised that PyScript is very alpha and under heavy development. There are many known issues, from usability to loading times, and you should expect things to change often. We encourage people to play and explore with PyScript, but at this time we do not recommend using it for production.</p>
<div class="social">
<figure class="profile">
<svg width="256px" height="209px" viewBox="0 0 256 209" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid">
<g>
<path d="M256,25.4500259 C246.580841,29.6272672 236.458451,32.4504868 225.834156,33.7202333 C236.678503,27.2198053 245.00583,16.9269929 248.927437,4.66307685 C238.779765,10.6812633 227.539325,15.0523376 215.57599,17.408298 C205.994835,7.2006971 192.34506,0.822 177.239197,0.822 C148.232605,0.822 124.716076,24.3375931 124.716076,53.3423116 C124.716076,57.4586875 125.181462,61.4673784 126.076652,65.3112644 C82.4258385,63.1210453 43.7257252,42.211429 17.821398,10.4359288 C13.3005011,18.1929938 10.710443,27.2151234 10.710443,36.8402889 C10.710443,55.061526 19.9835254,71.1374907 34.0762135,80.5557137 C25.4660961,80.2832239 17.3681846,77.9207088 10.2862577,73.9869292 C10.2825122,74.2060448 10.2825122,74.4260967 10.2825122,74.647085 C10.2825122,100.094453 28.3867003,121.322443 52.413563,126.14673 C48.0059695,127.347184 43.3661509,127.988612 38.5755734,127.988612 C35.1914554,127.988612 31.9009766,127.659938 28.694773,127.046602 C35.3777973,147.913145 54.7742053,163.097665 77.7569918,163.52185 C59.7820257,177.607983 37.1354036,186.004604 12.5289147,186.004604 C8.28987161,186.004604 4.10888474,185.75646 0,185.271409 C23.2431033,200.173139 50.8507261,208.867532 80.5109185,208.867532 C177.116529,208.867532 229.943977,128.836982 229.943977,59.4326002 C229.943977,57.1552968 229.893412,54.8901664 229.792282,52.6381454 C240.053257,45.2331635 248.958338,35.9825545 256,25.4500259" fill="#55acee"></path>
</g>
</svg>
<div class="avatar"><img src="assets/images/avatar.jpg"></div>
<div class="bio">
<h5>pyscript_dev</h5>
<a href="https://twitter.com/pyscript_dev" target="_blank" class="link">@pyscript_dev</a>
<p>PyScript - programming for the 99%</p>
<a href="https://twitter.com/pyscript_dev" class="button twitter" target="_blank">Follow us on Twitter</a>
</div>
</figure>
</div>
<!-- begin readme content -->
<div class="readme">
<h1 id="pyscript">Say Hello to PyScript</h1>
<p>
PyScript is a framework that allows users to create rich Python applications in the browser using HTML's interface and the power of <a href="https://pyodide.org/en/stable/" target="_blank">Pyodide</a>, <a href="https://webassembly.org/" target="_blank">WASM</a>, and modern web technologies. The PyScript framework provides users at every experience level with access to an expressive, easy-to-learn programming language with countless applications.</p>
<h2>What is PyScript? Well, here are some of the core components:</h2>
<!-- new copy from Fabio -->
<ul>
<li><strong>Python in the browser:</strong> Enable drop-in content, external file hosting (made possible by the <a href="https://pyodide.org/en/stable/" target="_blank">Pyodide project</a>, thank you!), and application hosting without the reliance on server-side configuration</li>
<li><strong>Python ecosystem:</strong> Run many popular packages of Python and the scientific stack (such as numpy, pandas, scikit-learn, and more)</li>
<li><strong>Python with JavaScript:</strong> Bi-directional communication between Python and Javascript objects and namespaces </li>
<li><strong>Environment management:</strong> Allow users to define what packages and files to include for the page code to run</li>
<li><strong>Visual application development:</strong> Use readily available curated UI components, such as buttons, containers, text boxes, and more</li>
<li><strong>Flexible framework:</strong> A flexible framework that can be leveraged to create and share new pluggable and extensible components directly in Python</li>
</ul>
<p>All that to say… PyScript is just HTML, only a bit (okay, maybe a lot) more powerful, thanks to the rich and accessible ecosystem of Python libraries. </p>
<p>In short, our mission is to bring programming for the 99%. </p>
<!-- end copy -->
</div>
<!-- end readme content -->
<footer class="site-footer">
<a href="https://github.com/anaconda/pyscript" class="footer-button" target="_blank">
<div class="icon">
<svg width="1024px" height="1024px" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" class="icon">
<path d="M511.6 76.3C264.3 76.2 64 276.4 64 523.5 64 718.9 189.3 885 363.8 946c23.5 5.9 19.9-10.8 19.9-22.2v-77.5c-135.7 15.9-141.2-73.9-150.3-88.9C215 726 171.5 718 184.5 703c30.9-15.9 62.4 4 98.9 57.9 26.4 39.1 77.9 32.5 104 26 5.7-23.5 17.9-44.5 34.7-60.8-140.6-25.2-199.2-111-199.2-213 0-49.5 16.3-95 48.3-131.7-20.4-60.5 1.9-112.3 4.9-120 58.1-5.2 118.5 41.6 123.2 45.3 33-8.9 70.7-13.6 112.9-13.6 42.4 0 80.2 4.9 113.5 13.9 11.3-8.6 67.3-48.8 121.3-43.9 2.9 7.7 24.7 58.3 5.5 118 32.4 36.8 48.9 82.7 48.9 132.3 0 102.2-59 188.1-200 212.9a127.5 127.5 0 0 1 38.1 91v112.5c.8 9 0 17.9 15 17.9 177.1-59.7 304.6-227 304.6-424.1 0-247.2-200.4-447.3-447.5-447.3z"/>
</svg>
</div>
<div>
<span>Project home</span>
</div>
</a>
<div class="copyright">
<p>© 2022 <a href="https://anaconda.com" target="_blank">Anaconda</a>, Inc.
</div>
</footer>
</section>
</main>
<script>
// Typing animation
function setupTypewriter(t) {
var HTML = t.innerHTML;
t.innerHTML = '';
var cursorPosition = 0,
tag = '',
writingTag = false,
tagOpen = false,
typeSpeed = 100,
tempTypeSpeed = 0;
var type = function() {
if (writingTag === true) {
tag += HTML[cursorPosition];
}
if (HTML[cursorPosition] === '<') {
tempTypeSpeed = 0;
if (tagOpen) {
tagOpen = false;
writingTag = true;
} else {
tag = '';
tagOpen = true;
writingTag = true;
tag += HTML[cursorPosition];
}
}
if (!writingTag && tagOpen) {
tag.innerHTML += HTML[cursorPosition];
}
if (!writingTag && !tagOpen) {
if (HTML[cursorPosition] === ' ') {
tempTypeSpeed = 0;
}
else {
tempTypeSpeed = (Math.random() * typeSpeed) + 50;
}
t.innerHTML += HTML[cursorPosition];
}
if (writingTag === true && HTML[cursorPosition] === '>') {
tempTypeSpeed = (Math.random() * typeSpeed) + 50;
writingTag = false;
if (tagOpen) {
var newSpan = document.createElement('span');
t.appendChild(newSpan);
newSpan.innerHTML = tag;
tag = newSpan.firstChild;
}
}
cursorPosition += 1;
if (cursorPosition < HTML.length - 1) {
setTimeout(type, tempTypeSpeed);
}
};
return {
type: type
};
}
let typer = document.getElementById('typewriter');
typewriter = setupTypewriter(typewriter);
typewriter.type();
</script>
<!-- BEGIN HEAP INTEGRATION -->
<script type="text/javascript">
window.heap=window.heap||[],heap.load=function(e,t){window.heap.appid=e,window.heap.config=t=t||{};var r=document.createElement("script");r.type="text/javascript",r.async=!0,r.src="https://cdn.heapanalytics.com/js/heap-"+e+".js";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(r,a);for(var n=function(e){return function(){heap.push([e].concat(Array.prototype.slice.call(arguments,0)))}},p=["addEventProperties","addUserProperties","clearEventProperties","identify","resetIdentity","removeEventProperty","setEventProperties","track","unsetEventProperty"],o=0;o<p.length;o++)heap[p[o]]=n(p[o])};
heap.load("758475466");
</script>
<!-- END HEAP INTEGRATION -->
</body>
</html>