Modern menu selection in command prompt for command lines app!
- 𧑠Option 1 (Recommend) : Pip
- Easily run:
pip install better-pick
- Easily run:
- Option 2 : Manual Install
- Easily download
.py
files fromRelease
tab than drag it into your Project folder. - Install requirements with
pip install colorama keyboard
- Easily download
Support: Python 3.x & Windows (Linux seems supported too but I haven't tested yet)
BetterPick
is very easy too use! π
Pick("Your menu title goes here!",["Your selection here","Sec1","Sec2"],(True or False - Multiselect) )
Note: In Default, To move up or down selection use key W,S
. Press Enter
to submit choose. Also in multichoose , press Spacebar
to check a selection (To change these key , look for "Change key-binding" in Advance use below)
Code:
from BetterPick import Pick
# For single choose
# print(Pick("Your menu title goes here!",["Your selection here","Sec1","Sec2"],False))
# For multiselect
# print(Pick("Your menu title goes here!",["Your selection here","Sec1","Sec2"],True))
from BetterPick import Pick
from colorama import Fore
print(Pick("Programming Languages",["Python","Java","C++"],highlight_color=Fore.BLUE))
# Set highlight color to blue
BetterPick's Highlight use
Colorama
(Really Good Library).
import BetterPick
from BetterPick import Pick
BetterPick.INDICATOR = "*"
# Set INDICATOR from ">" to "*"
print(Pick("Programming Languages",["Python","Java","C++"]))
Fun Fact: You can add color to BetterPick's Indicator too(Only recommend for v1.1a and above & I recommend using Colorama
for colors). For example :
import BetterPick
from BetterPick import Pick
from colorama import Fore,Style
BetterPick.COLOR_INDICATOR = f"{Fore.RED}*{Style.RESET_ALL}" # Indicator WITH color
BetterPick.INDICATOR = "*" # Indicator WITHOUT color
print(Pick("Programming Languages",["Python","Java","C++"]))
import BetterPick
from BetterPick import Pick
BetterPick.MULTISELECT_CHECK = "[x]"
BetterPick.MULTISELECT_UNCHECK = "[ ]"
print(Pick("Programming Languages",["Python","Java","C++"],multiselect=True))
Fun Fact: You can set Select box with colors too!
from BetterPick import Pick
print(Pick("Programming Languages",["Python","Java","C++"],multiselect=True,auto_choose=[0]))
import BetterPick
from BetterPick import Pick
from colorama import Fore,Style
print(Pick("Programming Languages",["Python","Java","C++"],popup_animation=True))
Without Pop-up animation | With Pop-up animation |
---|---|
from BetterPick import Pick
Key = {
"UP":"up arrow", # Change UP key from "W" to Arrow-Up
"DOWN":"down arrow", # Change DOWN key from "S" to Arrow-Down
"SUBMIT":"enter",
"MULTISELECT_CHOOSE":"space"
}
print(Pick("Programming Languages",["Python","Java","C++"],key=Key))
Fun Fact: The menu title argument can be String
or Function
!