repo
stringlengths
7
90
file_url
stringlengths
81
315
file_path
stringlengths
4
228
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:38:15
2026-01-05 02:33:18
truncated
bool
2 classes
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/file_handle/File handle text/counter.py
file_handle/File handle text/counter.py
""" Class resposible for counting words for different files: - Reduce redundant code - Easier code management/debugging - Code readability """ ## ! Is there any other way than doing it linear? ## ! What will be test cases of it? # ! Please do let me know. ## ! Can add is digit, isspace methods too later on. # ! Base...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/file_handle/File handle text/question 5.py
file_handle/File handle text/question 5.py
"""Write a function in python to count the number of lowercase alphabets present in a text file “happy.txt""" import time import os from counter import Counter print( "You will see the count of lowercase, uppercase and total count of alphabets in provided file.." ) file_path = input("Please, Enter file path: ")...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/file_handle/File handle text/input,output and error streams.py
file_handle/File handle text/input,output and error streams.py
# practicing with streams import sys sys.stdout.write("Enter the name of the file") file = sys.stdin.readline() with open( file.strip(), ) as F: while True: ch = F.readlines() for i in ch: # ch is the whole file,for i in ch gives lines, for j in i gives letters,for j in i.split gives words ...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/file_handle/File handle text/file handle 12 length of line in text file.py
file_handle/File handle text/file handle 12 length of line in text file.py
import os import time file_name = input("Enter the file name to create:- ") print(file_name) def write_to_file(file_name): if os.path.exists(file_name): print(f"Error: {file_name} already exists.") return with open(file_name, "a") as F: while True: text = input("enter an...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/file_handle/File handle text/question 2.py
file_handle/File handle text/question 2.py
"""Write a method/function DISPLAYWORDS() in python to read lines from a text file STORY.TXT, using read function and display those words, which are less than 4 characters.""" print("Hey!! You can print the word which are less then 4 characters") def display_words(file_path): try: with open(file_path) ...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/file_handle/File handle text/question 6.py
file_handle/File handle text/question 6.py
"""Write a function in python to count the number of lowercase alphabets present in a text file “happy.txt”""" from counter import Counter def lowercase(): with open("happy.txt") as F: word_counter = Counter(F.read()) print( f"The total number of lower case letters are {word_counter....
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/file_handle/File handle text/question3.py
file_handle/File handle text/question3.py
"""Write a user-defined function named count() that will read the contents of text file named “happy.txt” and count the number of lines which starts with either “I‟ or “M‟.""" import os import time file_name = input("Enter the file name to create:- ") # step1: print(file_name) def write_to_file(file_name): if ...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/simple_calculator/simple_calculator.py
simple_calculator/simple_calculator.py
# Define functions for each operation def add(x, y): return x + y def subtract(x, y): return x - y def multiply(x, y): return x * y def divide(x, y): # Prevent division by zero if y == 0: return "Error: Division by zero is not allowed" return x / y # Display the options to the us...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Industrial_developed_hangman/src/hangman/main.py
Industrial_developed_hangman/src/hangman/main.py
import json import random import time from enum import Enum from pathlib import Path from typing import Callable, List import requests from colorama import Fore, Style DEBUG = False success_code = 200 request_timeout = 1000 data_path = Path(__file__).parent.parent.parent / "Data" year = 4800566455 class Source(Enum...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Industrial_developed_hangman/src/hangman/__init__.py
Industrial_developed_hangman/src/hangman/__init__.py
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Industrial_developed_hangman/tests/__init__.py
Industrial_developed_hangman/tests/__init__.py
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Industrial_developed_hangman/tests/test_hangman/test_main.py
Industrial_developed_hangman/tests/test_hangman/test_main.py
from typing import Callable, List import pytest import requests_mock from src.hangman.main import ( MainProcess, Source, parse_word_from_site, ) class FkPrint(object): def __init__(self) -> None: self.container: List[str] = [] def __call__(self, value_to_print: str) -> None: sel...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Industrial_developed_hangman/tests/test_hangman/__init__.py
Industrial_developed_hangman/tests/test_hangman/__init__.py
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/dialogs/messagebox.py
dialogs/messagebox.py
# Use the MessageBox() function to display a simple message box. from quo.dialog import MessageBox MessageBox(title="Example dialog window", text="Do you want to continue?")
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/cli_master/cli_master.py
cli_master/cli_master.py
import os import sys from pprint import pprint sys.path.append(os.path.realpath(".")) import inquirer # Take authentication input from the user questions = [ inquirer.List( "authentication", # This is the key message="Choose an option", choices=["Login", "Sign up", "Exit"], ), ] answ...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/cli_master/database_import_countries.py
cli_master/database_import_countries.py
import requests url = "https://api.countrystatecity.in/v1/countries" headers = {"X-CSCAPI-KEY": "API_KEY"} response = requests.request("GET", url, headers=headers) print(response.text)
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/cli_master/validation_page.py
cli_master/validation_page.py
import re def phone_validation(phone_number): # Match a typical US phone number format (xxx) xxx-xxxx pattern = re.compile(r"^\(\d{3}\) \d{3}-\d{4}$") return bool(pattern.match(phone_number)) # Example usage: phone_number_input = input("Enter phone number: ") if phone_validation(phone_number_input): ...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/wiki/wiki.py
wiki/wiki.py
# In this program you ask it about any topic and it will show you the data from wikipedia # pip install wikipedia import wikipedia import tkinter as tk from tkinter import ( Label, Button, Entry, Text, messagebox, SOLID, GROOVE, StringVar, WORD, END, ) # import PIL as ImageTK ...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Flappy Bird - created with tkinter/Tubes.py
Flappy Bird - created with tkinter/Tubes.py
from random import randint from threading import Thread from Background import Background from Bird import Bird from PIL.Image import open as openImage from PIL.ImageTk import PhotoImage class Tubes(Thread): """ Classe para criar tubos """ __distance = 0 __move = 10 __pastTubes = [] def...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Flappy Bird - created with tkinter/Background.py
Flappy Bird - created with tkinter/Background.py
from tkinter import Tk, Canvas from PIL.Image import open as openImage from PIL.ImageTk import PhotoImage class Background(Canvas): """ Classe para gerar um plano de fundo animado """ __background = [] __stop = False def __init__(self, tk_instance, *geometry, fp="background.png", animation_...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Flappy Bird - created with tkinter/Flappy Bird.py
Flappy Bird - created with tkinter/Flappy Bird.py
import pygame import random # Initialize Pygame pygame.init() # Set up display screen_width = 500 screen_height = 700 screen = pygame.display.set_mode((screen_width, screen_height)) pygame.display.set_caption("Flappy Bird") # Load images bird_image = pygame.image.load("bird.png").convert_alpha() pipe_image = pygame....
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Flappy Bird - created with tkinter/Settings.py
Flappy Bird - created with tkinter/Settings.py
import os from json import dumps from json import loads class Settings(object): """ Classe com todas as configurações do jogo """ # Configurações da janela window_name = "Flappy Bird" window_rz = (False, False) window_fullscreen = True window_width = None window_height = None ...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Flappy Bird - created with tkinter/Bird.py
Flappy Bird - created with tkinter/Bird.py
from threading import Thread from Background import Background from PIL.Image import open as openImage from PIL.ImageTk import PhotoImage class Bird(Thread): """ Classe para criar um pássaro """ __tag = "Bird" __isAlive = None __going_up = False __going_down = 0 __times_skipped = 0 ...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Electronics_Algorithms/resistance.py
Electronics_Algorithms/resistance.py
def resistance_calculator( material: str, length: float, section: float, temperature: float ): """ material is a string indicating the material of the wire length is a floating value indicating the length of the wire in meters diameter is a floating value indicating the diameter of the wire in mil...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Electronics_Algorithms/Ohms_law.py
Electronics_Algorithms/Ohms_law.py
def ohms_law(v=0, i=0, r=0): if v == 0: result = i * r return result elif i == 0: result = v / r return result elif r == 0: result = v / i return result else: return 0
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Youtube Downloader With GUI/main.py
Youtube Downloader With GUI/main.py
# libraraies from pytube import * import os from tkinter import * from tkinter.filedialog import * from tkinter.messagebox import * from threading import * file_size = 0 q = input("") if q == "shutdown": os.system("shutdown -s") # function progress to keep check of progress of function. def progress(stream=Non...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Snake Game Using Turtle/food.py
Snake Game Using Turtle/food.py
""" This file handles the creation of food. Its placement is now controlled by the main game logic to ensure it spawns within the correct boundaries. """ from turtle import Turtle import random import colors class Food(Turtle): """ This class generates food for the snake to eat. """ def __init__(self): ...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Snake Game Using Turtle/scoreboard.py
Snake Game Using Turtle/scoreboard.py
""" This file manages the display of the score, high score, and game messages. It now positions the score dynamically in the top-left corner. """ from turtle import Turtle, Screen import colors # Constants for styling and alignment ALIGNMENT = "left" SCORE_FONT = ("Lucida Sans", 20, "bold") MESSAGE_FONT = ("Courier", ...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Snake Game Using Turtle/main.py
Snake Game Using Turtle/main.py
""" This is the main file that runs the Snake game. It handles screen setup, dynamic boundaries, UI controls (buttons), game state management, and the main game loop. """ from turtle import Screen, Turtle from snake import Snake from food import Food from scoreboard import Scoreboard from wall import Wall import colors...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Snake Game Using Turtle/wall.py
Snake Game Using Turtle/wall.py
"""This file creates a responsive boundary wall that adapts to the game window size.""" from turtle import Turtle, Screen import colors class Wall: """ This class creates a wall around the game screen that adjusts to its dimensions. """ def __init__(self): self.screen = Screen() self.create_wa...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Snake Game Using Turtle/snake.py
Snake Game Using Turtle/snake.py
""" This file is responsible for creating the snake and managing its movement, extension, and reset functionality. """ from turtle import Turtle import colors STARTING_POSITIONS = [(0, 0), (-20, 0), (-40, 0)] MOVE_DISTANCE = 20 UP, DOWN, LEFT, RIGHT = 90, 270, 180, 0 class Snake: """ This class creates a snake bo...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Snake Game Using Turtle/colors.py
Snake Game Using Turtle/colors.py
""" This file contains the color palette for the game, now including colors for the new interactive buttons. """ # A fresh and vibrant color theme # --> food.py FOOD_COLOR = "#C70039" # A bright, contrasting red # --> main.py BG_COLOR = '#F0F8FF' # AliceBlue, a very light and clean background # --> scoreboard.py GA...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/ExtractThumbnailFromVideo/extract_thumbnail_from_video.py
ExtractThumbnailFromVideo/extract_thumbnail_from_video.py
import cv2 import os def extract_thumbnail(video_path, frame_size): """ Extracts a thumbnail frame from a video and saves it as an image file. Args: video_path (str): The path to the input video file. frame_size (tuple): A tuple containing the desired dimensions (width, height) for the th...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/CliYoutubeDownloader/CliYoutubeDownloader.py
CliYoutubeDownloader/CliYoutubeDownloader.py
# libraraies import sys import pytube class YouTubeDownloder: def __init__(self): self.url = str(input("Enter the URL of video : ")) self.youtube = pytube.YouTube( self.url, on_progress_callback=YouTubeDownloder.onProgress ) self.showTitle() def showTitle(self): ...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/rearrange-files/rearrange-files.py
rearrange-files/rearrange-files.py
# author : Avee Chakraborty # department of software engineering, Daffodil inernational University # Bangladesh import os import shutil class RearrangeFile(object): def __init__(self): self.folder_path = os.getcwd() self.list_of_all_files = os.listdir(self.folder_path) def make_folder_and_re...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Windows_Wallpaper_Script/wallpaper_extract.py
Windows_Wallpaper_Script/wallpaper_extract.py
import os import shutil import time from PIL import Image class Wallpaper: # Set Environment Variables username = os.environ["USERNAME"] # An Amazing Code You Will Love To Have # All file urls file_urls = { "wall_src": "C:\\Users\\" + username + "\\AppData\\Local\\Packages...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/News_App/Newsapp.py
News_App/Newsapp.py
import solara as sr import yfinance as yf from patterns import Company_Name from datetime import datetime as date, timedelta srart_date = date.today() end_date = date.today() + timedelta(days=1) def News(symbol): get_Data = yf.Ticker(symbol) # news section try: NEWS = get_Data.news sr....
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/News_App/patterns.py
News_App/patterns.py
patterns = { "CDLHARAMI": "Harami Pattern", "CDLHARAMICROSS": "Harami Cross Pattern", "CDL2CROWS": "Two Crows", "CDL3BLACKCROWS": "Three Black Crows", "CDL3INSIDE": "Three Inside Up/Down", "CDL3LINESTRIKE": "Three-Line Strike", "CDL3OUTSIDE": "Three Outside Up/Down", "CDL3STARSINSOUTH": ...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/BoardGame-CLI/uno.py
BoardGame-CLI/uno.py
# uno game # import random from typing import List """ Generate the UNO deck of 108 cards. Doctest examples: >>> deck = buildDeck() >>> len(deck) 108 >>> sum(1 for c in deck if 'Wild' in c) 8 Return: list of card strings (e.g. 'Red 7', 'Wild Draw Four') """ def buildDeck() -> List[str]: deck: List[...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/BoardGame-CLI/python.py
BoardGame-CLI/python.py
import random # Define the game board with snakes and ladders snakes_and_ladders = { 2: 38, 7: 14, 8: 31, 15: 26, 16: 6, 21: 42, 28: 84, 36: 44, 46: 25, 49: 11, 51: 67, 62: 19, 64: 60, 71: 91, 74: 53, 78: 98, 87: 94, 89: 68, 92: 88, 95: 75...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/BoardGame-CLI/snakeLadder.py
BoardGame-CLI/snakeLadder.py
import random # Taking players data players = {} # stores players name their locations isReady = {} current_loc = 1 # variable for iterating location imp = True # players input function def player_input(): global players global current_loc global isReady x = True while x: player_num =...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Automated Scheduled Call Reminders/schedular.py
Automated Scheduled Call Reminders/schedular.py
# schedular code for blocking schedular as we have only 1 process to run from apscheduler.schedulers.blocking import BlockingScheduler from caller import search sched = BlockingScheduler() # Schedule job_function to be called every two hours sched.add_job(search, "interval", hours=1) # for testing instead add hou...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Automated Scheduled Call Reminders/caller.py
Automated Scheduled Call Reminders/caller.py
# The project automates calls for people from the firebase cloud database and the schedular keeps it running and checks for entries # every 1 hour using aps scedular # The project can be used to set 5 min before reminder calls to a set of people for doing a particular job from firebase_admin import credentials, firesto...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/VoiceRepeater/__main__.py
VoiceRepeater/__main__.py
import time import speech_recognition as sr import os import playsound import shutil shutil.rmtree("spoken") os.mkdir("spoken") speeches = [] def callback(recognizer, audio): with open("spoken/" + str(len(speeches)) + ".wav", "wb") as file: file.write(audio.get_wav_data()) playsound.playsound("spo...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/image2pdf/image2pdf.py
image2pdf/image2pdf.py
from PIL import Image import os class image2pdf: def __init__(self): self.validFormats = (".jpg", ".jpeg", ".png", ".JPG", ".PNG") self.pictures = [] self.directory = "" self.isMergePDF = True def getUserDir(self): """Allow user to choose image directory""" m...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Face and eye Recognition/face_recofnation_first.py
Face and eye Recognition/face_recofnation_first.py
import cv2 as cv def detect_faces_and_eyes(): """ Detects faces and eyes in real-time using the webcam. Press 'q' to exit the program. """ # Load the pre-trained classifiers for face and eye detection face_cascade = cv.CascadeClassifier(r"..\libs\haarcascade_frontalface_default.xml") eye_...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Face and eye Recognition/gesture_control.py
Face and eye Recognition/gesture_control.py
import cv2 as cv # Read the image in grayscale img = cv.imread(r"..\img\hand1.jpg", cv.IMREAD_GRAYSCALE) # Apply thresholding to create a binary image _, thresholded = cv.threshold(img, 70, 255, cv.THRESH_BINARY) # Find contours in the binary image contours, _ = cv.findContours(thresholded.copy(), cv.RETR_TREE, cv.C...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Python_chatting_application/client.py
Python_chatting_application/client.py
import socket import threading flag = 0 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) hostname = input("Enter your host :: ") s.connect((hostname, 1023)) nickname = input("Enter your Name :: ") def recieve(): while True: try: msg = s.recv(1024).decode("utf-8") if msg == "N...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Python_chatting_application/server.py
Python_chatting_application/server.py
import socket import threading s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind((socket.gethostname(), 1023)) print(socket.gethostname()) s.listen(5) clients = [] nickename = [] def Client_Handler(cli): while True: try: reply = cli.recv(1024).decode("utf-8") if reply ...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/ThirdAI/Terms and Conditions/TkinterUI.py
ThirdAI/Terms and Conditions/TkinterUI.py
import tkinter as tk from tkinter.font import Font from tkinter import messagebox from tkinter import filedialog from ThirdAI import NeuralDBClient as Ndb class ThirdAIApp: """ A GUI application for using the ThirdAI neural database client to train and query data. """ def __init__(self, root): ...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/ThirdAI/Terms and Conditions/ThirdAI.py
ThirdAI/Terms and Conditions/ThirdAI.py
from thirdai import licensing, neural_db as ndb class NeuralDBClient: def __init__(self): # Activating ThirdAI Key licensing.activate("ADD-YOUR-THIRDAI-ACTIVATION-KEY") # Creating NeuralBD variable to access Neural Database self.db = ndb.NeuralDB(user_id="my_user") def train(...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/PDF/header_footer.py
PDF/header_footer.py
from fpdf import FPDF # Author: @NavonilDas class MyPdf(FPDF): def header(self): # Uncomment the line below to add logo if needed # self.image('somelogo.png',12,10,25,25) # Draw Image ar (12,10) with height = 25 and width = 25 self.set_font("Arial", "B", 18) self.text(27, 10, "Ge...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/PDF/demerge_pdfs.py
PDF/demerge_pdfs.py
""" Python program to split large pdf(typically textbook) into small set of pdfs, maybe chapterwise to enhance the experience of reading and feasibility to study only specific parts from the large original textbook """ import PyPDF2 path = input() merged_pdf = open(path, mode="rb") pdf = PyPDF2.PdfFileReader(merged...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/PDF/basic.py
PDF/basic.py
from fpdf import FPDF # Author: @NavonilDas pdf = FPDF() # Set Author Name of the PDF pdf.set_author("@NavonilDas") # Set Subject of The PDF pdf.set_subject("python") # Set the Title of the PDF pdf.set_title("Generating PDF with Python") pdf.add_page() # Set Font family Courier with font size 28 pdf.set_font("Couri...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/PDF/images.py
PDF/images.py
import os from PIL import Image from fpdf import FPDF # Author: @NavonilDas # Example to Append all the images inside a folder to pdf pdf = FPDF() # Size of a A4 Page in mm Where P is for Potrait and L is for Landscape A4_SIZE = {"P": {"w": 210, "h": 297}, "L": {"w": 297, "h": 210}} # pdf may produce empty page so ...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Collatz Sequence/Collatz Sequence.py
Collatz Sequence/Collatz Sequence.py
def collatz_sequence(n): """Generate and print the Collatz sequence for n.""" steps = [n] while n != 1: if n % 2 == 0: n = n // 2 else: n = 3 * n + 1 steps.append(n) return steps # --- Main Program --- try: num = int(input("Enter a positive integer: ...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/depreciated_programs/corona_cases.py
depreciated_programs/corona_cases.py
import sys try: import requests except ImportError: print("Please Install Requests Module With Command 'pip install requests'") sys.exit(1) from time import sleep url = "https://api.covid19api.com/summary" visit = requests.get(url).json() NewConfirmed = visit["Global"]["NewConfirmed"] TotalConfirmed = vi...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/UI-Apps/clock.py
UI-Apps/clock.py
import tkinter # retrieve system's time from time import strftime # ------------------main code----------------------- # initializing the main UI object top = tkinter.Tk() # setting title of the App top.title("Clock") # restricting the resizable property top.resizable(0, 0) def time(): string = strftime("%H:%M:...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/PongPong_Game/pongpong.py
PongPong_Game/pongpong.py
# ./PongPong/pongpong.py import pyglet from pong import load # Variables, Considering a vertical oriented window for game WIDTH = 600 # Game Window Width HEIGHT = 600 # Game Window Height BORDER = 10 # Walls Thickness/Border Thickness RADIUS = 12 # Ball Radius PWIDTH = 120 # Paddle Width PHEIGHT = 15 # Paddle H...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/PongPong_Game/pong/load.py
PongPong_Game/pong/load.py
# ./PongPong/pong/load.py from . import ball, paddle, rectangle from typing import Tuple def load_balls(win_size: Tuple, radius: float, speed: Tuple, batch=None): balls = [] ball_x = win_size[0] / 2 ball_y = win_size[1] / 2 new_ball = ball.BallObject(x=ball_x, y=ball_y, radius=radius, batch=batch) ...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/PongPong_Game/pong/rectangle.py
PongPong_Game/pong/rectangle.py
# ./PongPong/pong/rectangle.py import pyglet class RectangleObject(pyglet.shapes.Rectangle): def __init__(self, *args, **kwargs): super(RectangleObject, self).__init__(*args, **kwargs)
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/PongPong_Game/pong/paddle.py
PongPong_Game/pong/paddle.py
# ./PongPong/pong/paddle.py import pyglet from pyglet.window import key from typing import Tuple class Paddle(pyglet.shapes.Rectangle): def __init__(self, *args, **kwargs): super(Paddle, self).__init__(*args, **kwargs) self.acc_left, self.acc_right = 0.0, 0.0 self.rightx = 0 self...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/PongPong_Game/pong/ball.py
PongPong_Game/pong/ball.py
# ./PongPong/pong/ball.py import pyglet import random from typing import Tuple class BallObject(pyglet.shapes.Circle): def __init__(self, *args, **kwargs): super(BallObject, self).__init__(*args, **kwargs) self.color = (255, 180, 0) self.velocity_x, self.velocity_y = 0.0, 0.0 def upd...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/PongPong_Game/pong/__init__.py
PongPong_Game/pong/__init__.py
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Password Manager Using Tkinter/PGV.py
Password Manager Using Tkinter/PGV.py
import json new_data = { website_input.get():{ "email": email_input.get(), "password": passw_input.get() } } try: with open("data.json", "r") as data_file: data = json.load(data_file) except FileNotFoundError: with open("data.json", "w") as data_file: ...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Password Manager Using Tkinter/main.py
Password Manager Using Tkinter/main.py
import tkinter as tk from tkinter import messagebox, simpledialog import ttkbootstrap as ttk from ttkbootstrap.constants import * import pyperclip import json from random import choice, randint, shuffle # ---------------------------- CONSTANTS ------------------------------- # FONT_NAME = "Helvetica" # IMP: this is no...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/game_of_life/game_o_life.py
game_of_life/game_o_life.py
"""Conway's Game Of Life, Author Anurag Kumar(mailto:anuragkumarak95@gmail.com) Requirements: - numpy - random - time - matplotlib Python: - 3.5 Usage: - $python3 game_o_life <canvas_size:int> Game-Of-Life Rules: 1. Any live cell with fewer than two live neighbours dies, as if caused by under-popula...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/game_of_life/05_mixed_sorting.py
game_of_life/05_mixed_sorting.py
# Mixed sorting """ Given a list of integers nums, sort the array such that: All even numbers are sorted in increasing order All odd numbers are sorted in decreasing order The relative positions of the even and odd numbers remain the same Example 1 Input nums = [8, 13, 11, 90, -5, 4] Output [4, 13, 11, 8, -5, 90] E...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Search_Engine/test_data.py
Search_Engine/test_data.py
documents = [ "we should all strive to be happy", "happiness is all you need", "a cheerful heart is a happy one", "no way should we be sad", ] search = "happy"
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Search_Engine/backend.py
Search_Engine/backend.py
import sqlite3 import json class SearchEngine: """ It works by building a reverse index store that maps words to an id. To find the document(s) that contain a certain search term, we then take an intersection of the ids """ def __init__(self): """ Returns - None In...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Search_Engine/frontend.py
Search_Engine/frontend.py
from tkinter import * import backend def add_document(): document = add_documents_entry.get() se = backend.SearchEngine() print(se.index_document(document)) def find_term(): term = find_term_entry.get() se = backend.SearchEngine() print(se.find_documents(term)) if __name__ == "__main__": ...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/currency converter/main.py
currency converter/main.py
# cc program from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.QtWidgets import * from PyQt5 import QtWidgets, uic from PyQt5.QtCore import * import httpx from bs4 import BeautifulSoup def getVal(cont1, cont2): # Extract currency codes from user input (format assumed like "USD- United States Dollar"...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Sorting Algorithims/quicksort_linkedlist.py
Sorting Algorithims/quicksort_linkedlist.py
""" Given a linked list with head pointer, sort the linked list using quicksort technique without using any extra space Time complexity: O(NlogN), Space complexity: O(1) """ from __future__ import annotations class Node: def __init__(self, data: int) -> None: self.data = data self.next = None c...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Sorting Algorithims/heapsort_linkedlist.py
Sorting Algorithims/heapsort_linkedlist.py
class Node: def __init__(self, data): self.data = data self.next = None class LinkedList: def __init__(self): self.head = None def push(self, data): new_node = Node(data) new_node.next = self.head self.head = new_node def print_list(self): curr...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Sorting Algorithims/mergesort_linkedlist.py
Sorting Algorithims/mergesort_linkedlist.py
from __future__ import annotations class Node: def __init__(self, data: int) -> None: self.data = data self.next = None class LinkedList: def __init__(self): self.head = None def insert(self, new_data: int) -> None: new_node = Node(new_data) new_node.next = self....
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/linear-algebra-python/src/lib.py
linear-algebra-python/src/lib.py
# -*- coding: utf-8 -*- """ Created on Mon Feb 26 14:29:11 2018 @author: Christian Bender @license: MIT-license This module contains some useful classes and functions for dealing with linear algebra in python. Overview: - class Vector - function zeroVector(dimension) - function unitBasisVector(dimension,pos) - func...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/linear-algebra-python/src/Transformations2D.py
linear-algebra-python/src/Transformations2D.py
# 2D Transformations are regularly used in Linear Algebra. # I have added the codes for reflection, projection, scaling and rotation matrices. import numpy as np def scaling(scaling_factor): return scaling_factor * (np.identity(2)) # This returns a scaling matrix def rotation(angle): arr = np.empty([2, 2...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/linear-algebra-python/src/tests.py
linear-algebra-python/src/tests.py
# -*- coding: utf-8 -*- """ Created on Mon Feb 26 15:40:07 2018 @author: Christian Bender @license: MIT-license This file contains the test-suite for the linear algebra library. """ import math import unittest from lib import * class Test(unittest.TestCase): def test_component(self): """ test ...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Laundary System/code.py
Laundary System/code.py
id = 1 class LaundryService: def __init__( self, Name_of_customer, Contact_of_customer, Email, Type_of_cloth, Branded, Season, id, ): self.Name_of_customer = Name_of_customer self.Contact_of_customer = Contact_of_customer ...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Sorting Algorithms/Count sort.py
Sorting Algorithms/Count sort.py
def counting_sort(array1, max_val): m = max_val + 1 count = [0] * m for a in array1: # count occurences count[a] += 1 i = 0 for a in range(m): for c in range(count[a]): array1[i] = a i += 1 return array1 print(counting_sort([1, 2, 7, 3, 2, 1, 4,...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Sorting Algorithms/SortingAStringAlphabetically.py
Sorting Algorithms/SortingAStringAlphabetically.py
# Program to sort alphabetically the words form a string provided by the user my_str = "Hello this Is an Example With cased letters" # To take input from the user # my_str = input("Enter a string: ") # breakdown the string into a list of words words = my_str.split() # sort the list words.sort() # display the sorte...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Sorting Algorithms/sorting.py
Sorting Algorithms/sorting.py
arr = [7, 2, 8, 5, 1, 4, 6, 3] temp = 0 print("Elements of original array: ") for i in range(0, len(arr)): print(arr[i], end=" ") for i in range(0, len(arr)): for j in range(i + 1, len(arr)): if arr[i] > arr[j]: temp = arr[i] arr[i] = arr[j] arr[j] = temp print() ...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Sorting Algorithms/Iterative Merge Sort.py
Sorting Algorithms/Iterative Merge Sort.py
# Iterative Merge sort (Bottom Up) # Iterative mergesort function to # sort arr[0...n-1] def mergeSort(a): current_size = 1 # Outer loop for traversing Each # sub array of current_size while current_size < len(a) - 1: left = 0 # Inner loop for merge call # in a sub array ...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Sorting Algorithms/Sorting_List.py
Sorting Algorithms/Sorting_List.py
class Node: def __init__(self, data): self.data = data self.next = None class Linked_List: def __init__(self): self.head = None def Insert_At_End(self, new_data): new_node = Node(new_data) if self.head is None: self.head = new_node return ...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Sorting Algorithms/Cycle Sort.py
Sorting Algorithms/Cycle Sort.py
# Python program to impleament cycle sort def cycleSort(array): writes = 0 # Loop through the array to find cycles to rotate. for cycleStart in range(0, len(array) - 1): item = array[cycleStart] # Find where to put the item. pos = cycleStart for i in range(cycleStart + 1,...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Sorting Algorithms/quick_sort.py
Sorting Algorithms/quick_sort.py
def partition(nums, low, high): # We select the middle element to be the pivot. Some implementations select # the first element or the last element. Sometimes the median value becomes # the pivot, or a random one. There are many more strategies that can be # chosen or created. pivot = nums[(low + hi...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Sorting Algorithms/stooge_sort.py
Sorting Algorithms/stooge_sort.py
# See what stooge sort dooes # https://www.youtube.com/watch?v=vIDkfrSdID8 def stooge_sort_(arr, l, h): if l >= h: return 0 # If first element is smaller than last, then swap if arr[l] > arr[h]: t = arr[l] arr[l] = arr[h] arr[h] = t # If there are more than 2 element...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Sorting Algorithms/heap_sort.py
Sorting Algorithms/heap_sort.py
def heapify(nums, heap_size, root_index): # Assume the index of the largest element is the root index largest = root_index left_child = (2 * root_index) + 1 right_child = (2 * root_index) + 2 # If the left child of the root is a valid index, and the element is greater # than the current largest...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Sorting Algorithms/wave_sort.py
Sorting Algorithms/wave_sort.py
def sortInWave(arr, n): arr.sort() for i in range(0, n - 1, 2): arr[i], arr[i + 1] = arr[i + 1], arr[i] arr = [] arr = input("Enter the arr") sortInWave(arr, len(arr)) for i in range(0, len(arr)): print(arr[i], " ")
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Sorting Algorithms/Tim_sort.py
Sorting Algorithms/Tim_sort.py
"""Author : Mohit Kumar Tim Sort implemented in python Time Complexity : O(n log(n)) Space Complexity :O(n) """ # Python3 program to perform TimSort. RUN = 32 # This function sorts array from left index to # to right index which is of size atmost RUN def insertionSort(arr, left, right): for i in range(left + 1...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Sorting Algorithms/bubblesortpgm.py
Sorting Algorithms/bubblesortpgm.py
"""Bubble Sort Bubble Sort is the simplest sorting algorithm that works by repeatedly swapping the adjacent elements if they are in wrong order. Example: First Pass: ( 5 1 4 2 8 ) –> ( 1 5 4 2 8 ), Here, algorithm compares the first two elements, and swaps since 5 > 1. ( 1 5 4 2 8 ) –> ( 1 4 5 2 8 ), Swap since 5 > 4 ...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Sorting Algorithms/Heap sort.py
Sorting Algorithms/Heap sort.py
# Python program for implementation of heap Sort # To heapify subtree rooted at index i. # n is size of heap def heapify(arr, n, i): largest = i # Initialize largest as root l = 2 * i + 1 # left = 2*i + 1 r = 2 * i + 2 # right = 2*i + 2 # See if left child of root exists and is # greater than r...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Sorting Algorithms/selectionSort.py
Sorting Algorithms/selectionSort.py
list = [] N = int(input("Enter The Size Of List")) for i in range(0, N): a = int(input("Enter The number")) list.append(a) # Let's sort list in ascending order using Selection Sort # Every time The Element Of List is fetched and the smallest element in remaining list is found and if it comes out # to be sma...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Sorting Algorithms/insertion_sort.py
Sorting Algorithms/insertion_sort.py
def insertion_sort(nums): # Start on the second element as we assume the first element is sorted for i in range(1, len(nums)): item_to_insert = nums[i] # And keep a reference of the index of the previous element j = i - 1 # Move all items of the sorted segment forward if they are...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Sorting Algorithms/pigeonhole_sort.py
Sorting Algorithms/pigeonhole_sort.py
# know what is Pigeonhole_principle # https://www.youtube.com/watch?v=IeTLZPNIPJQ def pigeonhole_sort(a): # (number of pigeonholes we need) my_min = min(a) my_max = max(a) size = my_max - my_min + 1 # total pigeonholes holes = [0] * size # filling up the pigeonholes. for x in a: ...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Sorting Algorithms/dual_pivot_quicksort.py
Sorting Algorithms/dual_pivot_quicksort.py
def dual_pivot_quicksort(arr, low, high): """ Performs Dual-Pivot QuickSort on the input array. Dual-Pivot QuickSort is an optimized version of QuickSort that uses two pivot elements to partition the array into three segments in each recursive call. This improves performance by reducing the number ...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Sorting Algorithms/Sort the values of first list using second list.py
Sorting Algorithms/Sort the values of first list using second list.py
# one list using # the other list def sort_list(list1, list2): zipped_pairs = zip(list2, list1) z = [x for _, x in sorted(zipped_pairs)] return z # driver code x = ["a", "b", "c", "d", "e", "f", "g", "h", "i"] y = [0, 1, 1, 0, 1, 2, 2, 0, 1] print(sort_list(x, y)) x = ["g", "e", "e", "k", "s", "f", ...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Sorting Algorithms/Counting-sort.py
Sorting Algorithms/Counting-sort.py
# python program for counting sort (updated) n = int(input("please give the number of elements\n")) print("okey now plase enter n numbers seperated by spaces") tlist = list(map(int, input().split())) k = max(tlist) n = len(tlist) def counting_sort(tlist, k, n): """Counting sort algo with sort in place. Args: ...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Sorting Algorithms/Shell Sort.py
Sorting Algorithms/Shell Sort.py
# Python program for implementation of Shell Sort def shellSort(arr): # Start with a big gap, then reduce the gap n = len(arr) gap = n / 2 # Do a gapped insertion sort for this gap size. # The first gap elements a[0..gap-1] are already in gapped # order keep adding one more element until the ...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false
geekcomputers/Python
https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Sorting Algorithms/Bubble_sort.py
Sorting Algorithms/Bubble_sort.py
def bubble_sort(Lists): for i in range(len(Lists)): for j in range(len(Lists) - 1): # We check whether the adjecent number is greater or not if Lists[j] > Lists[j + 1]: Lists[j], Lists[j + 1] = Lists[j + 1], Lists[j] # Lets the user enter values of an array and veri...
python
MIT
21cbdf223aadd1c28293570d1106fe47af6e9434
2026-01-04T14:42:18.827821Z
false