From 634d3ebff26b8f40a1d13595ade1341ef432786e Mon Sep 17 00:00:00 2001 From: lighting9999 Date: Tue, 15 Jul 2025 17:07:43 +0800 Subject: [PATCH 1/8] Update settings.json --- .vscode/settings.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index b881eff7b1d..e69de29bb2d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +0,0 @@ -{ - "python.analysis.autoImportCompletions": true -} \ No newline at end of file From eaa50c86e46255ca3156f306c86c99a94c216d21 Mon Sep 17 00:00:00 2001 From: lighting9999 Date: Tue, 15 Jul 2025 17:15:13 +0800 Subject: [PATCH 2/8] fix imports for schedular.py --- Automated Scheduled Call Reminders/schedular.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Automated Scheduled Call Reminders/schedular.py b/Automated Scheduled Call Reminders/schedular.py index 905adad611f..5f03cb06b18 100644 --- a/Automated Scheduled Call Reminders/schedular.py +++ b/Automated Scheduled Call Reminders/schedular.py @@ -1,6 +1,7 @@ # schedular code for blocking schedular as we have only 1 process to run -from apscheduler.schedulers.blocking import BlockingScheduler +from apscheduler.schedulers.blocking import APScheduler +from blocking_scheduler import BlockingScheduler from caller import search From e42cfc79b6ef878695a718cd41b204ee85708bdf Mon Sep 17 00:00:00 2001 From: lighting9999 Date: Tue, 15 Jul 2025 17:35:53 +0800 Subject: [PATCH 3/8] fix problems for ruff --- .../schedular.py | 3 +- cli_master/cli_master.py | 97 ++++++++++++------- 2 files changed, 64 insertions(+), 36 deletions(-) diff --git a/Automated Scheduled Call Reminders/schedular.py b/Automated Scheduled Call Reminders/schedular.py index 5f03cb06b18..905adad611f 100644 --- a/Automated Scheduled Call Reminders/schedular.py +++ b/Automated Scheduled Call Reminders/schedular.py @@ -1,7 +1,6 @@ # schedular code for blocking schedular as we have only 1 process to run -from apscheduler.schedulers.blocking import APScheduler -from blocking_scheduler import BlockingScheduler +from apscheduler.schedulers.blocking import BlockingScheduler from caller import search diff --git a/cli_master/cli_master.py b/cli_master/cli_master.py index f57a3b192bb..71cbfdb74ac 100644 --- a/cli_master/cli_master.py +++ b/cli_master/cli_master.py @@ -5,7 +5,7 @@ import sys sys.path.append(os.path.realpath(".")) -import inquirer # noqa +import inquirer # Take authentication input from the user questions = [ @@ -20,40 +20,80 @@ # Just making pipelines class Validation: - def phone_validation(): + @staticmethod + def phone_validation(answer, current): # Think over how to make a validation for phone number? - pass + return True - def email_validation(): - pass + @staticmethod + def email_validation(answer, current): + return True - def password_validation(): - pass + @staticmethod + def password_validation(answer, current): + return True + @staticmethod def username_validation(): pass - def country_validation(): + @staticmethod + def fname_validation(answer, current): + # Add your first name validation logic here + return True + + @staticmethod + def lname_validation(answer, current): + # Add your last name validation logic here + return True + + @staticmethod + def country_validation(answer, current): # All the countries in the world??? # JSON can be used. # Download the file + return True - def state_validation(): + @staticmethod + def state_validation(answer, current): # All the states in the world?? # The state of the selected country only. - pass + return True - def city_validation(): + @staticmethod + def city_validation(answer, current): # All the cities in the world?? # JSON can be used. - pass + return True + + @staticmethod + def password_confirmation(answer, current): + return True + + @staticmethod + def address_validation(answer, current): + return True + + @staticmethod + def login_username(answer, current): + # Add your username validation logic here + return True + @staticmethod + def login_password(answer, current): + # Add your password validation logic here + return True # Have an option to go back. # How can I do it? -if answers["authentication"] == "Login": - print("Login") +if answers is not None and answers.get("authentication") == "Login": questions = [ + inquirer. + Text( + "surname", + message="What's your last name (surname)?", + validate=Validation.lname_validation, + ), inquirer.Text( "username", message="What's your username?", @@ -65,11 +105,10 @@ def city_validation(): validate=Validation.login_password, ), ] + answers = inquirer.prompt(questions) - -elif answers["authentication"] == "Sign up": +elif answers is not None and answers.get("authentication") == "Sign up": print("Sign up") - questions = [ inquirer.Text( "name", @@ -78,7 +117,8 @@ def city_validation(): ), inquirer.Text( "surname", - message="What's your last name(surname)?, validate=Validation.lname), {name}?", + message="What's your last name (surname)?", + validate=Validation.lname_validation, ), inquirer.Text( "phone", @@ -96,7 +136,7 @@ def city_validation(): validate=Validation.password_validation, ), inquirer.Text( - "password", + "password_confirm", message="Confirm your password", validate=Validation.password_confirmation, ), @@ -110,27 +150,16 @@ def city_validation(): message="What's your country", validate=Validation.country_validation, ), - inquirer.Text( - "state", - message="What's your state", - validate=Validation.state_validation, - ), - inquirer.Text( - "city", - message="What's your city", - validate=Validation.city_validation, - ), inquirer.Text( "address", message="What's your address", validate=Validation.address_validation, ), ] -# Also add optional in the above thing. -# Have string manipulation for the above thing. -# How to add authentication of google to command line? -elif answers["authentication"] == "Exit": + answers = inquirer.prompt(questions) + +elif answers is not None and answers.get("authentication") == "Exit": print("Exit") sys.exit() -pprint(answers) +pprint(answers) \ No newline at end of file From 5011ccb0389c6d208bd5cedc4ff6548be5f16912 Mon Sep 17 00:00:00 2001 From: lighting9999 Date: Tue, 15 Jul 2025 17:40:22 +0800 Subject: [PATCH 4/8] fix imports from ruff --- cli_master/cli_master.py | 1 - youtubedownloader.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/cli_master/cli_master.py b/cli_master/cli_master.py index 71cbfdb74ac..24a7457428c 100644 --- a/cli_master/cli_master.py +++ b/cli_master/cli_master.py @@ -2,7 +2,6 @@ import sys from pprint import pprint -import sys sys.path.append(os.path.realpath(".")) import inquirer diff --git a/youtubedownloader.py b/youtubedownloader.py index 12e9c310876..df448b93890 100644 --- a/youtubedownloader.py +++ b/youtubedownloader.py @@ -1,5 +1,5 @@ -from tkinter import filedialog, messagebox +from tkinter import Button, Entry, Label, Tk, filedialog, messagebox from threading import Thread from pytube import YouTube From 2beedaa749b5a8a4b663ae5ce88e2bb296afddd5 Mon Sep 17 00:00:00 2001 From: lighting9999 Date: Tue, 15 Jul 2025 17:41:30 +0800 Subject: [PATCH 5/8] readme this py file --- Trending youtube videos.py | 43 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Trending youtube videos.py diff --git a/Trending youtube videos.py b/Trending youtube videos.py new file mode 100644 index 00000000000..a14535e4ddc --- /dev/null +++ b/Trending youtube videos.py @@ -0,0 +1,43 @@ +''' + Python program that uses the YouTube Data API to fetch the top 10 trending YouTube videos. +You’ll need to have an API key from Google Cloud Platform to use the YouTube Data API. + +First, install the google-api-python-client library if you haven’t already: +pip install google-api-python-client + +Replace 'YOUR_API_KEY' with your actual API key. This script will fetch and print the titles, +channels, and view counts of the top 10 trending YouTube videos in India. +You can change the regionCode to any other country code if needed. + +Then, you can use the following code: + +''' + +from googleapiclient.discovery import build + +# Replace with your own API key +API_KEY = 'YOUR_API_KEY' +YOUTUBE_API_SERVICE_NAME = 'youtube' +YOUTUBE_API_VERSION = 'v3' + +def get_trending_videos(): + youtube = build(YOUTUBE_API_SERVICE_NAME, YOUTUBE_API_VERSION, developerKey=API_KEY) + + # Call the API to get the top 10 trending videos + request = youtube.videos().list( + part='snippet,statistics', + chart='mostPopular', + regionCode='IN', # Change this to your region code + maxResults=10 + ) + response = request.execute() + + # Print the video details + for item in response['items']: + title = item['snippet']['title'] + channel = item['snippet']['channelTitle'] + views = item['statistics']['viewCount'] + print(f'Title: {title}\nChannel: {channel}\nViews: {views}\n') + +if __name__ == '__main__': + get_trending_videos() From 2f7168aab739a33531df960bc1952050649f9645 Mon Sep 17 00:00:00 2001 From: lighting9999 Date: Tue, 15 Jul 2025 17:52:25 +0800 Subject: [PATCH 6/8] readme py name --- HangMan Game => HangMan Game.py | 0 LETTER GUESSER => LETTER GUESSER.py | 0 ...ial of a number => Python Program for factorial of a number.py | 0 greattwono => greattwono.py | 0 hamming-numbers => hamming-numbers.py | 0 mathfunctions => mathfunctions.py | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename HangMan Game => HangMan Game.py (100%) rename LETTER GUESSER => LETTER GUESSER.py (100%) rename Python Program for factorial of a number => Python Program for factorial of a number.py (100%) rename greattwono => greattwono.py (100%) rename hamming-numbers => hamming-numbers.py (100%) rename mathfunctions => mathfunctions.py (100%) diff --git a/HangMan Game b/HangMan Game.py similarity index 100% rename from HangMan Game rename to HangMan Game.py diff --git a/LETTER GUESSER b/LETTER GUESSER.py similarity index 100% rename from LETTER GUESSER rename to LETTER GUESSER.py diff --git a/Python Program for factorial of a number b/Python Program for factorial of a number.py similarity index 100% rename from Python Program for factorial of a number rename to Python Program for factorial of a number.py diff --git a/greattwono b/greattwono.py similarity index 100% rename from greattwono rename to greattwono.py diff --git a/hamming-numbers b/hamming-numbers.py similarity index 100% rename from hamming-numbers rename to hamming-numbers.py diff --git a/mathfunctions b/mathfunctions.py similarity index 100% rename from mathfunctions rename to mathfunctions.py From dfa926fa4ab208da108f626bb86e567db649564b Mon Sep 17 00:00:00 2001 From: lighting9999 Date: Tue, 15 Jul 2025 18:01:16 +0800 Subject: [PATCH 7/8] readme py names --- inheritance_YahV1729.python => inheritance_YahV1729.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename inheritance_YahV1729.python => inheritance_YahV1729.py (100%) diff --git a/inheritance_YahV1729.python b/inheritance_YahV1729.py similarity index 100% rename from inheritance_YahV1729.python rename to inheritance_YahV1729.py From 21f479397c56333466f8ed1d2681a2b08bf0b69f Mon Sep 17 00:00:00 2001 From: lighting9999 Date: Tue, 15 Jul 2025 18:07:07 +0800 Subject: [PATCH 8/8] fix tic-tac-toe.py 1 errors --- tic-tac-toe.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tic-tac-toe.py b/tic-tac-toe.py index 8956be21237..a3dd41e4062 100644 --- a/tic-tac-toe.py +++ b/tic-tac-toe.py @@ -90,7 +90,10 @@ def CheckWin(): board[choice] = Mark player += 1 CheckWin() - + if choice < 1 or choice > 9: + print("Invalid Position! Please choose a position between 1 and 9.") + time.sleep(2) + continue os.system("cls") DrawBoard() if Game == Draw: