mirror of
https://github.com/pyscript/pyscript.git
synced 2022-05-01 19:47:48 +03:00
add files in public folder
This commit is contained in:
BIN
pyscriptjs/public/favicon.png
Normal file
BIN
pyscriptjs/public/favicon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
16
pyscriptjs/public/index.html
Normal file
16
pyscriptjs/public/index.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||
|
||||
<title>Svelte app</title>
|
||||
|
||||
<link rel="icon" type="image/png" href="favicon.png" />
|
||||
<link rel="stylesheet" href="build/bundle.css" />
|
||||
|
||||
<script defer src="build/bundle.js"></script>
|
||||
</head>
|
||||
|
||||
<body></body>
|
||||
</html>
|
||||
20
pyscriptjs/public/repl.html
Normal file
20
pyscriptjs/public/repl.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||
|
||||
<title>Svelte app</title>
|
||||
|
||||
<link rel="icon" type="image/png" href="favicon.png" />
|
||||
<link rel="stylesheet" href="build/bundle.css" />
|
||||
|
||||
<script defer src="build/bundle.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div>
|
||||
<py-repl id="my-repl" auto-generate="true"> </py-repl>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
25
pyscriptjs/public/repl2.html
Normal file
25
pyscriptjs/public/repl2.html
Normal file
@@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||
|
||||
<title>Svelte app</title>
|
||||
|
||||
<link rel="icon" type="image/png" href="favicon.png" />
|
||||
<link rel="stylesheet" href="build/bundle.css" />
|
||||
|
||||
<script defer src="build/bundle.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="w-full h-full">
|
||||
<div class="flex">
|
||||
<div class="w-2/3"><py-repl id="my-repl" auto-generate="true" target="output"> </py-repl></div>
|
||||
<div id="output" class="w-1/3"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
23
pyscriptjs/public/simple_script.html
Normal file
23
pyscriptjs/public/simple_script.html
Normal file
@@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||
|
||||
<title>Svelte app</title>
|
||||
|
||||
<link rel="icon" type="image/png" href="favicon.png" />
|
||||
<link rel="stylesheet" href="build/bundle.css" />
|
||||
|
||||
<script defer src="build/bundle.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="outputDiv" style="background-color:yellow"></div>
|
||||
<py-script target="outputDiv">
|
||||
from datetime import datetime
|
||||
now = datetime.now()
|
||||
now.strftime("%m/%d/%Y, %H:%M:%S")
|
||||
</py-script>
|
||||
</body>
|
||||
</html>
|
||||
45
pyscriptjs/public/simple_script2.html
Normal file
45
pyscriptjs/public/simple_script2.html
Normal file
@@ -0,0 +1,45 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||
|
||||
<title>Svelte app</title>
|
||||
|
||||
<link rel="icon" type="image/png" href="favicon.png" />
|
||||
<link rel="stylesheet" href="build/bundle.css" />
|
||||
|
||||
<script defer src="build/bundle.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="outputDiv"></div>
|
||||
<div id="outputDiv2" style="background-color: blueviolet"></div>
|
||||
<div id="outputDiv3" style="background-color: yellow"></div>
|
||||
<py-script target="outputDiv">
|
||||
from datetime import datetime
|
||||
now = datetime.now()
|
||||
now.strftime("%m/%d/%Y, %H:%M:%S")
|
||||
</py-script>
|
||||
|
||||
<py-script>
|
||||
from datetime import datetime
|
||||
import asyncio
|
||||
|
||||
async def foo():
|
||||
while True:
|
||||
await asyncio.sleep(1)
|
||||
now = datetime.now()
|
||||
output = now.strftime("%m/%d/%Y, %H:%M:%S")
|
||||
pyscript.write("outputDiv2", output)
|
||||
|
||||
out3 = Element("outputDiv3")
|
||||
if output[-1] in ["0", "4", "8"]:
|
||||
out3.write("It's espresso time!")
|
||||
else:
|
||||
out3.clear()
|
||||
|
||||
pyscript.run_until_complete(foo())
|
||||
</py-script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user