Skip to content

Commit 149a79d

Browse files
author
Muhammad Ali
committed
1
1 parent 472d300 commit 149a79d

File tree

2 files changed

+53
-201
lines changed

2 files changed

+53
-201
lines changed

LICENSE

Lines changed: 0 additions & 201 deletions
This file was deleted.

main.py

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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.)"])

0 commit comments

Comments
 (0)