Skip to content

Commit 30efa22

Browse files
committed
Add hello world example
1 parent 143be0f commit 30efa22

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

examples/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# LTK - Copyrights Reserved 2023 - chrislaffra.com - See LICENSE
22

33
from examples import custom
4+
from examples import helloworld
45
from examples import table
56
from examples import tictactoe
67

78
elements = [
9+
helloworld.create(),
810
tictactoe.create(),
911
table.create(),
1012
custom.create(),

examples/helloworld.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# LTK - Copyrights Reserved 2023 - chrislaffra.com - See LICENSE
2+
3+
import ltk
4+
5+
hello = ltk.Text("Hello World")
6+
7+
def create():
8+
return hello.attr("name", "Hello World")

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ <h1>The PyScript LTK Kitchen Sink</h1>
2929
"ltk/ltk.js",
3030
"ltk/ltk.css",
3131
"examples/__init__.py",
32+
"examples/helloworld.py",
3233
"examples/tictactoe.py",
3334
"examples/tictactoe.css",
3435
"examples/custom.py",

0 commit comments

Comments
 (0)