1- # Better Pick
2- from colorama import init as colorama_init
3- from colorama import Fore
4- from colorama import Style
5- import keyboard ,os ,time
6- colorama_init ()
7-
8- INDICATOR = ">"
9- def Pick (pick_title ,listc ,multiselect = False ,highlight_color = Fore .GREEN ,key = {"UP" :"w" ,"DOWN" :"s" ,"SUBMIT" :"enter" ,"MULTISELECT_CHOOSE" :"space" }):
10- select = 0
11- if multiselect :
12- multiselectc = []
13- utype = "( )"
14- ctype = "(x)"
15- else :
16- utype = ""
17- ctype = ""
18-
19- while True :
20- if type (pick_title ) == str :
21- print (pick_title )
22- else :
23- pick_title ()
24- for i in range (0 ,len (listc )):
25- if multiselect :
26- if i in multiselectc :
27- cm = ctype
28- else :
29- cm = utype
30- prefix = INDICATOR + " "
31- if i == select :
32- prefix = INDICATOR + " "
33- print (prefix + cm + " " + f"{ highlight_color } { listc [i ]} { Style .RESET_ALL } " )
34- else :
35- prefix = (len (INDICATOR )+ 1 ) * " "
36- print (prefix + cm + " " + listc [i ])
37- elif multiselect == False :
38- if i == select :
39- prefix = INDICATOR
40- print (prefix + " " + f"{ highlight_color } { listc [i ]} { Style .RESET_ALL } " )
41- else :
42- prefix = (len (INDICATOR )+ 1 ) * " "
43- print (prefix + " " + listc [i ])
44- while True :
45- if keyboard .is_pressed (key ["UP" ]):
46- if not select == 0 :
47- select -= 1
48- break
49- elif keyboard .is_pressed (key ["DOWN" ]):
50- if not select == len (listc )- 1 :
51- select += 1
52- break
53- elif keyboard .is_pressed (key ["SUBMIT" ]):
54- if multiselect :
55- return multiselectc
56- else :
57- return (listc [select ],select )
58- elif keyboard .is_pressed (key ["MULTISELECT_CHOOSE" ]):
59- if multiselect :
60- if not select in multiselectc :
61- multiselectc .append (select )
62- else :
63- multiselectc .remove (select )
64- break
65- time .sleep (0.1 )
66- os .system ('cls' if os .name == 'nt' else 'clear' )
1+ # Go to Release tab to download :D
2+ # BetterPick Made by ScadeBlock
0 commit comments