File tree Expand file tree Collapse file tree 2 files changed +53
-201
lines changed
Expand file tree Collapse file tree 2 files changed +53
-201
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ import os
2+
3+ prompt_file = False
4+ csv_file = False
5+
6+ def clear_console ():
7+ # Clear the console based on the OS
8+ if os .name == 'posix' : # Unix/Linux/MacOS
9+ os .system ('clear' )
10+ elif os .name == 'nt' : # Windows
11+ os .system ('cls' )
12+ else :
13+ # Unsupported OS
14+ print ("Clearing the console is not supported on this operating system." )
15+
16+
17+ def check_files ():
18+ if os .path .exists ("prompt.txt" ):
19+ print (">Prompt Template Found." )
20+ else :
21+ print (">Prompt Template Missing" )
22+
23+ if os .path .exists ("key-values.csv" ):
24+ print (">CSV File Found." )
25+ else :
26+ print (">CSV File Missing" )
27+
28+
29+ def ask_choice (title : str , options : list ):
30+ while True :
31+ print (title + ":" )
32+ for index , item in iter (options ):
33+ print (f"{ index } . { item } " )
34+
35+ selection = input ()
36+ if type (selection ) is not int :
37+ print
38+ if selection > 0 and selection <= len (options ):
39+ return selection - 1
40+
41+
42+
43+
44+
45+
46+
47+
48+
49+ clear_console ()
50+ print ('Welcome to Python Prompt Generator.\n ' )
51+ print ('Please wait. Checking for required files and perimeters...' )
52+ check_files ()
53+ ask_choice ("Select mode" , ["Normal Mode" , "Description Mode (won't include title in prompt.)" ])
You can’t perform that action at this time.
0 commit comments