+> (yield) operator and nice debug output!
This commit is contained in:
parent
440bd2f153
commit
0ebe183cfe
4 changed files with 55 additions and 9 deletions
25
examples/mini.it
Normal file
25
examples/mini.it
Normal file
|
@ -0,0 +1,25 @@
|
|||
from textual.app import App, ComposeResult
|
||||
from textual.widgets import Header, Footer, TextArea
|
||||
|
||||
class Mini(App):
|
||||
"""A Textual app to manage stopwatches."""
|
||||
|
||||
BINDINGS = [("ctrl+o", "open", "Open"), ("ctrl+s", "save", "Save"), ("ctrl+alt+s", "save_as", "Save as")]
|
||||
|
||||
def compose(self) -> ComposeResult:
|
||||
"""Create child widgets for the app."""
|
||||
+> Header()
|
||||
+> TextArea()
|
||||
+> Footer()
|
||||
|
||||
def action_save(self) -> None:
|
||||
"""An action to save."""
|
||||
pass
|
||||
|
||||
def action_open(self) -> None: pass
|
||||
def action_save_as(self) -> None: pass
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app = Mini()
|
||||
app.run()
|
|
@ -4,6 +4,13 @@ def fibonacci(x: int) -> list[int]:
|
|||
for i in range(1, x):
|
||||
start.append <| start[i] + start[i - 1]
|
||||
return start
|
||||
def a():
|
||||
yield 1
|
||||
+> 2
|
||||
def b():
|
||||
+>> a()
|
||||
+>> a()
|
||||
b() |> list |> print
|
||||
a = 12 |> fibonacci
|
||||
b = a :: a :: a :: a
|
||||
c = b :: b :: b :: b
|
||||
|
@ -24,7 +31,7 @@ print(d3d2(x=2)(y=4))
|
|||
|
||||
a = 1
|
||||
a++
|
||||
a |> print ?? 11 |> print
|
||||
print(None ?? a) # 2
|
||||
'''a'''
|
||||
/*
|
||||
very bad code that is
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue