-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…#95) * added starting positions to print at * added `Optional[]` to class def * `field(default_factory=)` in class? * fixed quote issues * added option to README * implemented changes however function will not run * changed type hints of `dict` to `Position`, code still not functional * minor grammatical correction @coderabbitai Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * arguemtn is now passed as * Apply suggestions from code review * resolved conflicts * Update example/position.py * Update README.md --------- Co-authored-by: AN Long <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
- Loading branch information
1 parent
a7ee138
commit c72f339
Showing
3 changed files
with
35 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import curses | ||
import pick | ||
|
||
def main(stdscr): | ||
stdscr.addstr("hello world?\n") | ||
stdscr.get_wch() | ||
|
||
y, x = stdscr.getyx() | ||
|
||
title = "Please choose your favorite programming language: " | ||
options = ["Java", "JavaScript", "Python", "PHP", "C++", "Erlang", "Haskell"] | ||
option, index = pick.pick( | ||
options, | ||
title, | ||
indicator="=>", | ||
default_index=2, | ||
screen=stdscr, | ||
position=pick.Position(y=y, x=0) # comment this to demonstrate the issue it solves | ||
) | ||
|
||
stdscr.addstr(f"\nYou choosed {option} at index {index}\n") | ||
stdscr.get_wch() | ||
|
||
curses.wrapper(main) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters