File tree Expand file tree Collapse file tree 6 files changed +129
-0
lines changed Expand file tree Collapse file tree 6 files changed +129
-0
lines changed Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html lang ="en ">
3
+ < head >
4
+ < meta charset ="utf-8 " />
5
+ < meta name ="viewport " content ="width=device-width,initial-scale=1 " />
6
+
7
+ < title > Svelte app</ title >
8
+
9
+ < link rel ="icon " type ="image/png " href ="favicon.png " />
10
+ < link rel ="stylesheet " href ="build/bundle.css " />
11
+
12
+ < script defer src ="build/bundle.js "> </ script >
13
+ </ head >
14
+
15
+ < body > </ body >
16
+ </ html >
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html lang ="en ">
3
+ < head >
4
+ < meta charset ="utf-8 " />
5
+ < meta name ="viewport " content ="width=device-width,initial-scale=1 " />
6
+
7
+ < title > Svelte app</ title >
8
+
9
+ < link rel ="icon " type ="image/png " href ="favicon.png " />
10
+ < link rel ="stylesheet " href ="build/bundle.css " />
11
+
12
+ < script defer src ="build/bundle.js "> </ script >
13
+ </ head >
14
+
15
+ < body >
16
+ < div >
17
+ < py-repl id ="my-repl " auto-generate ="true "> </ py-repl >
18
+ </ div >
19
+ </ body >
20
+ </ html >
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html lang ="en ">
3
+ < head >
4
+ < meta charset ="utf-8 " />
5
+ < meta name ="viewport " content ="width=device-width,initial-scale=1 " />
6
+
7
+ < title > Svelte app</ title >
8
+
9
+ < link rel ="icon " type ="image/png " href ="favicon.png " />
10
+ < link rel ="stylesheet " href ="build/bundle.css " />
11
+
12
+ < script defer src ="build/bundle.js "> </ script >
13
+ </ head >
14
+
15
+ < body >
16
+ < div class ="w-full h-full ">
17
+ < div class ="flex ">
18
+ < div class ="w-2/3 "> < py-repl id ="my-repl " auto-generate ="true " target ="output "> </ py-repl > </ div >
19
+ < div id ="output " class ="w-1/3 "> </ div >
20
+ </ div >
21
+ </ div >
22
+
23
+
24
+ </ body >
25
+ </ html >
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html lang ="en ">
3
+ < head >
4
+ < meta charset ="utf-8 " />
5
+ < meta name ="viewport " content ="width=device-width,initial-scale=1 " />
6
+
7
+ < title > Svelte app</ title >
8
+
9
+ < link rel ="icon " type ="image/png " href ="favicon.png " />
10
+ < link rel ="stylesheet " href ="build/bundle.css " />
11
+
12
+ < script defer src ="build/bundle.js "> </ script >
13
+ </ head >
14
+
15
+ < body >
16
+ < div id ="outputDiv " style ="background-color:yellow "> </ div >
17
+ < py-script target ="outputDiv ">
18
+ from datetime import datetime
19
+ now = datetime.now()
20
+ now.strftime("%m/%d/%Y, %H:%M:%S")
21
+ </ py-script >
22
+ </ body >
23
+ </ html >
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html lang ="en ">
3
+ < head >
4
+ < meta charset ="utf-8 " />
5
+ < meta name ="viewport " content ="width=device-width,initial-scale=1 " />
6
+
7
+ < title > Svelte app</ title >
8
+
9
+ < link rel ="icon " type ="image/png " href ="favicon.png " />
10
+ < link rel ="stylesheet " href ="build/bundle.css " />
11
+
12
+ < script defer src ="build/bundle.js "> </ script >
13
+ </ head >
14
+
15
+ < body >
16
+ < div id ="outputDiv "> </ div >
17
+ < div id ="outputDiv2 " style ="background-color: blueviolet "> </ div >
18
+ < div id ="outputDiv3 " style ="background-color: yellow "> </ div >
19
+ < py-script target ="outputDiv ">
20
+ from datetime import datetime
21
+ now = datetime.now()
22
+ now.strftime("%m/%d/%Y, %H:%M:%S")
23
+ </ py-script >
24
+
25
+ < py-script >
26
+ from datetime import datetime
27
+ import asyncio
28
+
29
+ async def foo():
30
+ while True:
31
+ await asyncio.sleep(1)
32
+ now = datetime.now()
33
+ output = now.strftime("%m/%d/%Y, %H:%M:%S")
34
+ pyscript.write("outputDiv2", output)
35
+
36
+ out3 = Element("outputDiv3")
37
+ if output[-1] in ["0", "4", "8"]:
38
+ out3.write("It's espresso time!")
39
+ else:
40
+ out3.clear()
41
+
42
+ pyscript.run_until_complete(foo())
43
+ </ py-script >
44
+ </ body >
45
+ </ html >
You can’t perform that action at this time.
0 commit comments