Browse Source

Add two simple examples

option-search
Sebastian Lohff 3 years ago
parent
commit
6655fd097a
  1. 14
      examples/simple1.py
  2. 17
      examples/simple2.py

14
examples/simple1.py

@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
#!/usr/bin/env python3
from clintermission import CliMenu
def main():
q = ["Foo", "Bar", "Baz baz baz baz baz"]
m = CliMenu(q, "Time to choose:\n")
m.get_selection()
print("You selected", m.get_selection())
if __name__ == '__main__':
main()

17
examples/simple2.py

@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
#!/usr/bin/env python3
from clintermission import CliMenu, CliMenuCursor, CliMenuTheme
def main():
q = ["Foo", "Bar", "Baz baz baz baz baz"]
m = CliMenu(q, "Time to choose:\n",
indent=2, dedent_selection=True,
cursor=CliMenuCursor.TRIANGLE,
style=CliMenuTheme.BLUE)
m.get_selection()
print("You selected", m.get_selection())
if __name__ == '__main__':
main()
Loading…
Cancel
Save