diff --git a/Projects/Password Generator/README.md b/Projects/Password Generator/README.md new file mode 100644 index 0000000..1e11f8d --- /dev/null +++ b/Projects/Password Generator/README.md @@ -0,0 +1,44 @@ +# Password Generator + +The Password Generator is a simple Python program that allows you to generate strong and random passwords with specified complexity and length. This program runs in the command-line interface (CLI) and provides a user-friendly way to create passwords. + +## Features + +- Generate random passwords with various complexity levels (low, medium, high). +- Choose the desired length of the password. +- Center-align the generated password for a clear display. + +## Getting Started + +1. Clone this repository to your local machine. + +```shell +git clone https://github.com/[username]/password-generator.git +cd password-generator +``` + +2. Run the application. + +```shell +python main.py +``` + +3. Follow the on-screen instructions to specify the length and complexity of the password. + +4. The generated password will be displayed in the center of the screen. + +5. You can choose to generate another password or exit the program. + +## Dependencies + +- Python 3.x + +## Contributing + +Contributions are welcome! If you find any issues or have ideas for improvements, please open an issue or create a pull request. + +## Acknowledgments + +- [Python](https://www.python.org/) for providing a powerful and versatile programming language. +- [os](https://docs.python.org/3/library/os.html) module for clearing the screen and getting terminal size. +- [random](https://docs.python.org/3/library/random.html) and [string](https://docs.python.org/3/library/string.html) modules for password generation. diff --git a/Projects/Password Generator/main.py b/Projects/Password Generator/main.py new file mode 100644 index 0000000..b2c5ec7 --- /dev/null +++ b/Projects/Password Generator/main.py @@ -0,0 +1,62 @@ +import random +import string +import os + +def clear_screen(): + if os.name == 'posix': + os.system('clear') + else: + os.system('cls') + +def generate_password(length): + clear_screen() + + # Define character sets for different complexity levels + lowercase_chars = string.ascii_lowercase + uppercase_chars = string.ascii_uppercase + digits = string.digits + special_chars = string.punctuation + + while True: + complexity = input("Choose complexity (low, medium, high): ").lower() + + if complexity not in ["low", "medium", "high"]: + print("Invalid choice. Please choose 'low', 'medium', or 'high'.") + continue + + if complexity == "low": + character_set = lowercase_chars + digits + elif complexity == "medium": + character_set = lowercase_chars + uppercase_chars + digits + elif complexity == "high": + character_set = lowercase_chars + uppercase_chars + digits + special_chars + + # Generate the password + password = ''.join(random.choice(character_set) for _ in range(length)) + + # Center-align the output + term_width = os.get_terminal_size().columns + padding = (term_width - len(password)) // 2 + print(" " * padding + password) + break + +if __name__ == "__main__": + while True: + clear_screen() + length_str = input("Enter the desired length of the password: ") + + if not length_str.isdigit(): + input("Invalid input. Press Enter to continue...") + continue + + length = int(length_str) + + if length <= 0: + input("Invalid input. Press Enter to continue...") + continue + + generate_password(length) + + choice = input("Do you want to generate another password? (yes/no): ").lower() + if choice != "yes": + break \ No newline at end of file diff --git a/Projects/TODO App/README.md b/Projects/TODO App/README.md new file mode 100644 index 0000000..dd4163b --- /dev/null +++ b/Projects/TODO App/README.md @@ -0,0 +1,34 @@ +# ToDo List App + +ToDo List is a basic Python application that allows you to manage your tasks using a simple graphical user interface built with Tkinter. + +## Features + +- Add new tasks. +- Remove tasks. +- View your tasks in a clear and organized manner. + +## Getting Started + +1. Clone this repository to your local machine. + +2. Run the application. + +```shell +python app.py +``` + +3. Use the "Add Task" and "Remove Task" buttons to manage your tasks. + +## Dependencies + +- Python 3.x +- Tkinter (usually included with Python) + +## Contributing + +Contributions are welcome! If you find any issues or have ideas for improvements, please open an issue or create a pull request. + +## Acknowledgments + +- [Tkinter](https://docs.python.org/3/library/tkinter.html) for providing a simple GUI toolkit for Python. diff --git a/Projects/TODO App/app.py b/Projects/TODO App/app.py new file mode 100644 index 0000000..a960459 --- /dev/null +++ b/Projects/TODO App/app.py @@ -0,0 +1,55 @@ +import tkinter as tk +from tkinter import simpledialog, messagebox + +def add_task(): + task = simpledialog.askstring("Add Task", "Enter a new task:") + if task: + todo_list.append(task) + update_display() + +def remove_task(): + if not todo_list: + messagebox.showinfo("No Tasks", "No tasks to remove.") + return + + task_num = simpledialog.askinteger("Remove Task", "Enter the task number to remove:", minvalue=1, maxvalue=len(todo_list)) + if task_num: + del todo_list[task_num - 1] + update_display() + +def update_display(): + task_display.config(state=tk.NORMAL) + task_display.delete(1.0, tk.END) + for index, task in enumerate(todo_list, start=1): + task_display.insert(tk.END, f"{index}. {task}\n") + task_display.config(state=tk.DISABLED) + +def quit_app(): + window.destroy() + +# Initialize the main window +window = tk.Tk() +window.title("Fancy ToDo List") +window.geometry("500x500") # Set the window dimensions + +# Create a canvas with gradient background +canvas = tk.Canvas(window, bg="#002855", width=500, height=500) +canvas.pack() + +# Create GUI elements with customized appearance +add_button = tk.Button(window, text="Add Task", command=add_task, bg="#4286f4", fg="white", font=("Helvetica", 12)) +remove_button = tk.Button(window, text="Remove Task", command=remove_task, bg="#e74c3c", fg="white", font=("Helvetica", 12)) +quit_button = tk.Button(window, text="Quit", command=quit_app, bg="#34495e", fg="white", font=("Helvetica", 12)) +task_display = tk.Text(window, wrap=tk.WORD, state=tk.DISABLED, bg="#f2f2f2", font=("Helvetica", 12)) + +# Organize GUI elements using the grid layout +add_button_window = canvas.create_window(100, 30, window=add_button) +remove_button_window = canvas.create_window(250, 30, window=remove_button) +quit_button_window = canvas.create_window(400, 30, window=quit_button) +task_display_window = canvas.create_window(250, 250, window=task_display, width=400, height=300) + +# Initialize the to-do list +todo_list = [] + +# Start the GUI event loop +window.mainloop() \ No newline at end of file