Browse Source

Add two simple examples

Sebastian Lohff 1 year ago
parent
commit
6655fd097a
2 changed files with 31 additions and 0 deletions
  1. 14
    0
      examples/simple1.py
  2. 17
    0
      examples/simple2.py

+ 14
- 0
examples/simple1.py View File

@@ -0,0 +1,14 @@
1
+#!/usr/bin/env python3
2
+from clintermission import CliMenu
3
+
4
+
5
+def main():
6
+    q = ["Foo", "Bar", "Baz baz baz baz baz"]
7
+    m = CliMenu(q, "Time to choose:\n")
8
+
9
+    m.get_selection()
10
+    print("You selected", m.get_selection())
11
+
12
+
13
+if __name__ == '__main__':
14
+    main()

+ 17
- 0
examples/simple2.py View File

@@ -0,0 +1,17 @@
1
+#!/usr/bin/env python3
2
+from clintermission import CliMenu, CliMenuCursor, CliMenuTheme
3
+
4
+
5
+def main():
6
+    q = ["Foo", "Bar", "Baz baz baz baz baz"]
7
+    m = CliMenu(q, "Time to choose:\n",
8
+                indent=2, dedent_selection=True,
9
+                cursor=CliMenuCursor.TRIANGLE,
10
+                style=CliMenuTheme.BLUE)
11
+
12
+    m.get_selection()
13
+    print("You selected", m.get_selection())
14
+
15
+
16
+if __name__ == '__main__':
17
+    main()

Loading…
Cancel
Save