Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/Swabhan/MHacks16
Browse files Browse the repository at this point in the history
  • Loading branch information
uzairname committed Nov 19, 2023
2 parents 7b21e70 + e5daf66 commit 7e65b65
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions sampleColor/color.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import sys

from colorama import init as colorama_init
from colorama import Fore
from colorama import Style

colorama_init()

def colorOutput(prompt, keywords):
for i in keywords:
prompt = prompt.replace(i, f"{Fore.RED}{i}{Style.RESET_ALL}")

return prompt

keywords = ["line", "syntax", "compile time", "run time", "error"]
prompt = "On line 19, there is a syntax error causing a compile time error. To resolve this, ..."

print(colorOutput(prompt, keywords))

0 comments on commit 7e65b65

Please sign in to comment.