From b57c91277923066afa17b9edb47407892dad31ee Mon Sep 17 00:00:00 2001 From: asvin Date: Thu, 16 Feb 2023 18:49:30 +0530 Subject: [PATCH] added keyboard interrupts to CLI (cherry picked from commit 7653489a28488fef31f123756462a61d72769b50) --- fuelishCLI.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fuelishCLI.py b/fuelishCLI.py index 6aa9cdcf..fb068b56 100644 --- a/fuelishCLI.py +++ b/fuelishCLI.py @@ -20,7 +20,7 @@ ###################################### -while(True): +while True: print("Welcome to Fuelish-CLI") print("Don't be foolish and know your prices") try: @@ -55,9 +55,11 @@ elif fuel == "d": l.append([dic["State"][i].capitalize(),dic["Price(D)"][i],dic["Change(D)"][i]]) if(len(l)==0): - print("*Incorrect State*") + print("*Skill issue. Know about your country!*") else: l.insert(0,["State","Price","Change"]) tablemaker(l) + except KeyboardInterrupt: + break except: - print("*Something went wrong!*") \ No newline at end of file + print("*Kuch to hua hai*") \ No newline at end of file