diff --git a/calendar_display/README.md b/calendar_display/README.md new file mode 100644 index 0000000..f177023 --- /dev/null +++ b/calendar_display/README.md @@ -0,0 +1,18 @@ +# Calendar App + +Simple GUI calendar application built with Python and Tkinter + +## Features + +- User-friendly interface +- Displays full year calendar (placeholder) +- Easy year input +- Exit button + +## How to Use + +1. Run the application: `python calendar_app.py` +2. Enter a year in the input field +3. Click "Show Calendar" button +4. A new window opens displaying the calendar (placeholder) +5. Click "Exit" to close the application \ No newline at end of file diff --git a/calendar_display/calendar_app.py b/calendar_display/calendar_app.py new file mode 100644 index 0000000..45907a7 --- /dev/null +++ b/calendar_display/calendar_app.py @@ -0,0 +1,49 @@ +import tkinter as tk +from tkinter import messagebox +import calendar + +def main(): + root = tk.Tk() + root.title("Calendar App") + root.geometry("300x150") + + tk.Label(root, text="Enter Year:").pack(pady=5) + year_entry = tk.Entry(root) + year_entry.pack(pady=5) + + def show_calendar(): + year = year_entry.get() + if not year.isdigit(): + messagebox.showerror("Invalid Input", "Please enter a valid year") + return + display_calendar(year) + + tk.Button(root, text="Show Calendar", command=show_calendar).pack(pady=5) + tk.Button(root, text="Exit", command=root.destroy).pack(pady=5) + + root.mainloop() + +def display_calendar(year): + try: + year = int(year) + if year < 1: + raise ValueError + cal = calendar.TextCalendar() + cal_str = cal.formatyear(year) + messagebox.showinfo(f"Calendar for {year}", cal_str) + except ValueError: + messagebox.showerror("Invalid Input", "Please enter a valid positive year") + + +def show_calendar(year): + try: + year = int(year) + if year < 1: + raise ValueError + cal = calendar.TextCalendar() + cal_str = cal.formatyear(year) + messagebox.showinfo(f"Calendar for {year}", cal_str) + except ValueError: + messagebox.showerror("Invalid Input", "Please enter a valid positive year") + + display_calendar(year) \ No newline at end of file diff --git a/finance_dashboard/README.md b/finance_dashboard/README.md new file mode 100644 index 0000000..bcd6045 --- /dev/null +++ b/finance_dashboard/README.md @@ -0,0 +1,9 @@ +# Finance Dashboard + +This is a beginner-friendly finance dashboard built with Flask. +It allows users to track expenses and view total spending. + +## Setup +1. Install requirements: + ```bash + pip install -r requirements.txt diff --git a/finance_dashboard/app.py b/finance_dashboard/app.py new file mode 100644 index 0000000..29a94a5 --- /dev/null +++ b/finance_dashboard/app.py @@ -0,0 +1,24 @@ +##finance dashboard issue :] +from flask import Flask, render_template_string + +app = Flask(__name__) + +# Sample expense data +expenses = [ + {"category": "Food", "amount": 120}, + {"category": "Rent", "amount": 800}, + {"category": "Transport", "amount": 60}, +] + +@app.route("/") +def dashboard(): + total = sum(e["amount"] for e in expenses) + categories = ", ".join(e["category"] for e in expenses) + return render_template_string(""" +
Total Spending: ${{ total }}
+Categories: {{ categories }}
+ """, total=total, categories=categories) + +if __name__ == "__main__": + app.run(debug=True) diff --git a/finance_dashboard/requirements.txt b/finance_dashboard/requirements.txt new file mode 100644 index 0000000..685627a --- /dev/null +++ b/finance_dashboard/requirements.txt @@ -0,0 +1,2 @@ +flask +matplotlib diff --git a/mood_tracker/README.md b/mood_tracker/README.md new file mode 100644 index 0000000..c713489 --- /dev/null +++ b/mood_tracker/README.md @@ -0,0 +1,16 @@ +# Habit Tracker App + +A simple Habit Tracker application using Python and Tkinter. + +## Features +- Add and track habits (placeholder) +- Habit streaks (placeholder) +- Analyze progress (placeholder) +- Exit button + +## How to Use +1. Run `python habit_tracker.py` +2. Enter a habit in the input box +3. Click "Add Habit" +4. Use placeholder functions for streaks and analysis +5. Click "Exit" to close the app diff --git a/mood_tracker/simple_calendar.py b/mood_tracker/simple_calendar.py new file mode 100644 index 0000000..6d19bb9 --- /dev/null +++ b/mood_tracker/simple_calendar.py @@ -0,0 +1,32 @@ +import tkinter as tk +from tkinter import messagebox + +def main(): + root = tk.Tk() + root.title("Habit Tracker") + root.geometry("400x300") + + tk.Label(root, text="Habit Tracker App").pack(pady=10) + + tk.Label(root, text="Enter Habit:").pack(pady=5) + habit_entry = tk.Entry(root) + habit_entry.pack(pady=5) + + def add_habit(): + habit = habit_entry.get() + if habit == "": + messagebox.showerror("Error", "Please enter a habit") + else: + print(f"Added habit: {habit} (placeholder)") + + tk.Button(root, text="Add Habit", command=add_habit).pack(pady=5) + tk.Button(root, text="Exit", command=root.destroy).pack(pady=5) + + root.mainloop() + +if __name__ == "__main__": + main() + + # habit_tracker.py (continued) +def show_streaks(): + print("Showing habit streaks (placeholder)") diff --git a/student_management/app.py b/student_management/app.py new file mode 100644 index 0000000..a49b107 --- /dev/null +++ b/student_management/app.py @@ -0,0 +1,153 @@ +import tkinter as tk +from tkinter import messagebox, simpledialog +import pandas as pd +import os + +# ============================== +# Hardcoded admin credentials +# ============================== +USERNAME = "admin" +PASSWORD = "password123" + +# File to store student data +DATA_FILE = "students.csv" + +# Ensure CSV exists +if not os.path.exists(DATA_FILE): + df = pd.DataFrame(columns=["Roll No", "Name", "Address", "DOB"]) + df.to_csv(DATA_FILE, index=False) + +# ============================== +# Helper functions +# ============================== +def get_students(): + return pd.read_csv(DATA_FILE) + +def save_students(df): + df.to_csv(DATA_FILE, index=False) + +def generate_roll_no(): + df = get_students() + if df.empty: + return 1 + else: + return df["Roll No"].max() + 1 + +# ============================== +# Student operations +# ============================== +def add_student(): + name = simpledialog.askstring("Input", "Enter student name:") + address = simpledialog.askstring("Input", "Enter student address:") + dob = simpledialog.askstring("Input", "Enter student DOB (YYYY-MM-DD):") + + if name and address and dob: + roll_no = generate_roll_no() + df = get_students() + df.loc[len(df)] = [roll_no, name, address, dob] + save_students(df) + messagebox.showinfo("Success", f"Student {name} added with Roll No {roll_no}") + else: + messagebox.showwarning("Input Error", "All fields are required!") + +def update_student(): + roll_no = simpledialog.askinteger("Input", "Enter roll number to update:") + df = get_students() + + if roll_no in df["Roll No"].values: + name = simpledialog.askstring("Input", "Enter new name (leave blank to keep same):") + address = simpledialog.askstring("Input", "Enter new address (leave blank to keep same):") + dob = simpledialog.askstring("Input", "Enter new DOB (leave blank to keep same):") + + idx = df.index[df["Roll No"] == roll_no][0] + + if name: + df.at[idx, "Name"] = name + if address: + df.at[idx, "Address"] = address + if dob: + df.at[idx, "DOB"] = dob + + save_students(df) + messagebox.showinfo("Success", f"Student with Roll No {roll_no} updated!") + else: + messagebox.showerror("Error", "Roll number not found!") + +def delete_student(): + roll_no = simpledialog.askinteger("Input", "Enter roll number to delete:") + df = get_students() + + if roll_no in df["Roll No"].values: + df = df[df["Roll No"] != roll_no] + save_students(df) + messagebox.showinfo("Deleted", f"Student with Roll No {roll_no} deleted!") + else: + messagebox.showerror("Error", "Roll number not found!") + +def search_student(): + choice = simpledialog.askstring("Search", "Search by 'roll' or 'name'?").lower() + df = get_students() + + if choice == "roll": + roll_no = simpledialog.askinteger("Input", "Enter roll number:") + result = df[df["Roll No"] == roll_no] + elif choice == "name": + name = simpledialog.askstring("Input", "Enter name:") + result = df[df["Name"].str.contains(name, case=False, na=False)] + else: + messagebox.showerror("Error", "Invalid choice!") + return + + if not result.empty: + messagebox.showinfo("Result", result.to_string(index=False)) + else: + messagebox.showinfo("Result", "No matching student found.") + +# ============================== +# Login + Dashboard +# ============================== +def login(): + entered_username = username_entry.get() + entered_password = password_entry.get() + + if entered_username == USERNAME and entered_password == PASSWORD: + messagebox.showinfo("Login Success", "Welcome, Admin!") + root.destroy() + open_dashboard() + else: + messagebox.showerror("Login Failed", "Invalid username or password") + +def open_dashboard(): + dashboard = tk.Tk() + dashboard.title("Student Management System") + dashboard.geometry("400x400") + + tk.Label(dashboard, text="Student Management System", + font=("Arial", 14, "bold")).pack(pady=15) + + tk.Button(dashboard, text="Add Student", command=add_student, width=25).pack(pady=5) + tk.Button(dashboard, text="Update Student", command=update_student, width=25).pack(pady=5) + tk.Button(dashboard, text="Delete Student", command=delete_student, width=25).pack(pady=5) + tk.Button(dashboard, text="Search Student", command=search_student, width=25).pack(pady=5) + tk.Button(dashboard, text="Exit", command=dashboard.quit, width=25).pack(pady=10) + + dashboard.mainloop() + +# ============================== +# Main Login Window +# ============================== +root = tk.Tk() +root.title("Admin Login") +root.geometry("300x200") + +tk.Label(root, text="Username:").pack(pady=5) +username_entry = tk.Entry(root) +username_entry.pack(pady=5) + +tk.Label(root, text="Password:").pack(pady=5) +password_entry = tk.Entry(root, show="*") +password_entry.pack(pady=5) + +tk.Button(root, text="Login", command=login).pack(pady=20) + +root.mainloop() diff --git a/student_management/students.csv b/student_management/students.csv new file mode 100644 index 0000000..5859a58 --- /dev/null +++ b/student_management/students.csv @@ -0,0 +1 @@ +Roll No,Name,Address,DOB diff --git a/todo_list/README.md b/todo_list/README.md new file mode 100644 index 0000000..2cc69bf --- /dev/null +++ b/todo_list/README.md @@ -0,0 +1,6 @@ +# To-Do List Application + +This is a simple To-Do List app skeleton using Tkinter. +Planned features: +- Add and remove tasks +- Google Calendar API integration for syncing tasks diff --git a/todo_list/todo.py b/todo_list/todo.py new file mode 100644 index 0000000..aa9b1cf --- /dev/null +++ b/todo_list/todo.py @@ -0,0 +1,44 @@ +# todo_app.py +""" +A simple To-Do List app skeleton using Tkinter. +Google Calendar API integration will be added later. +""" +from logging import root +import tkinter as tk + +def main(): + root = tk.Tk() + root.title("To-Do List") + root.geometry("400x400") + label = tk.Label(root, text="To-Do List App Skeleton") + label.pack(pady=20) + root.mainloop() + +if __name__ == "__main__": + main() + + +tasks = [] +def add_task(task): + tasks.append(task) + print(f"Task added: {task}") + + def remove_task(task): + if task in tasks: + tasks.remove(task) + print(f"Task removed: {task}") + else: + print(f"Task not found: {task}") + + print("Remove task function") + + add_button = tk.Button(root, text="Add Task", command=lambda: add_task("Sample Task")) + add_button.pack(pady=10) + remove_button = tk.Button(root, text="Remove Task", command=lambda: remove_task("Sample Task")) + remove_button.pack(pady=10) + print("Add task function") + + + def sync_with_google_calendar(): + # Placeholder function for Google Calendar API integration + print("Syncing with Google Calendar (placeholder)") diff --git a/word_frequency/README.md b/word_frequency/README.md new file mode 100644 index 0000000..e69de29 diff --git a/word_frequency/counter_sample.txt b/word_frequency/counter_sample.txt new file mode 100644 index 0000000..e69de29 diff --git a/word_frequency/word_frequency_counter.py b/word_frequency/word_frequency_counter.py new file mode 100644 index 0000000..7d11f54 --- /dev/null +++ b/word_frequency/word_frequency_counter.py @@ -0,0 +1,11 @@ +from collections import Counter + +def count_words(filename): + with open(filename, "r", encoding="utf-8") as f: + text = f.read().lower().split() + word_counts = Counter(text) + for word, count in word_counts.most_common(10): + print(f"{word}: {count}") + +if __name__ == "__main__": + count_words("counter_sample.txt")