From 3d7708aa9fa6864cee8310e245cf52f4a8888162 Mon Sep 17 00:00:00 2001 From: Navaneeth832 Date: Fri, 30 May 2025 14:23:31 +0530 Subject: [PATCH 1/2] headings for wifi and password --- AI_for_Guess_the_number/AI_for_Guess_the_number.py | 2 +- Wifi-Password/main.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/AI_for_Guess_the_number/AI_for_Guess_the_number.py b/AI_for_Guess_the_number/AI_for_Guess_the_number.py index f59a412d..47369bb1 100644 --- a/AI_for_Guess_the_number/AI_for_Guess_the_number.py +++ b/AI_for_Guess_the_number/AI_for_Guess_the_number.py @@ -94,7 +94,7 @@ print("Wanna go again? y for yes and anykey for no. ") i = input(""); if(i == "y"): - print(breaking * 10); + print(breaking * 10) a = int(input("Min: ")) b = int(input("Max: ")) diff --git a/Wifi-Password/main.py b/Wifi-Password/main.py index f93d4a04..8da5d08d 100644 --- a/Wifi-Password/main.py +++ b/Wifi-Password/main.py @@ -16,6 +16,8 @@ password=wifiPass[15].strip("psk="); print ("{:<30} {:<}".format(wifiname, password)) else: + print ("Wifiname Password") + print ("----------------------------------------") wifi = subprocess.check_output(['netsh', 'wlan', 'show', 'profiles']).decode('utf-8', errors="backslashreplace").split('\n') profiles = [i.split(":")[1][1:-1] for i in wifi if "All User Profile" in i] for i in profiles: From 15e5454b1140502b4292a4f275a9e22cb109091b Mon Sep 17 00:00:00 2001 From: Navaneeth832 Date: Fri, 30 May 2025 14:44:12 +0530 Subject: [PATCH 2/2] improved pywikisearch.py program --- Wikipedia-Search/pywikisearch.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Wikipedia-Search/pywikisearch.py b/Wikipedia-Search/pywikisearch.py index 46a11ddf..e4ef3440 100644 --- a/Wikipedia-Search/pywikisearch.py +++ b/Wikipedia-Search/pywikisearch.py @@ -5,4 +5,12 @@ while True: ques = input("What would you like to ask Wikipedia?") wikipedia.set_lang("en") #change "en" to convenient language for example wikipedia.set_lang("es") will set the language to spanish - print wikipedia.summary(ques, sentences=3) + try: + print(wikipedia.summary(ques, sentences=3)) + except wikipedia.exceptions.DisambiguationError as e: + print(f"DisambiguationError: {e}") + except wikipedia.exceptions.PageError as e: + print(f"PageError: {e}") + more = input("Do you want to ask anything else? (y/n)") + if more.lower() != 'y': + break \ No newline at end of file