Skip to content

Instantly share code, notes, and snippets.

View saibot07's full-sized avatar

saibot07

  • Neural Nexus Labs
  • The Cloud, Everywhere
  • Joined Apr 18, 2026
View GitHub Profile
@saibot07
saibot07 / csv_to_json_converter.py
Created April 20, 2026 11:42
A simple Python script to convert CSV files to JSON format.
import csv
import json
def csv_to_json(csv_file, json_file):
"""Convert CSV file to JSON format"""
data = []
with open(csv_file, mode='r') as file:
csv_reader = csv.DictReader(file)
for row in csv_reader:
@saibot07
saibot07 / fibonacci_generator.py
Created April 19, 2026 14:32
Generates a Fibonacci sequence up to a given count using a generator in Python.
def fibonacci_generator(n):
"""A generator to yield Fibonacci sequence up to n elements."""
a, b = 0, 1
for _ in range(n):
yield a
a, b = b, a + b
if __name__ == "__main__":
n = int(input("Enter the number of Fibonacci numbers you want: "))
print("Fibonacci sequence:")
@saibot07
saibot07 / convert_csv_to_json.py
Created April 19, 2026 13:39
A script to convert a CSV file into a JSON file.
import csv
import json
def convert_csv_to_json(csv_file_path, json_file_path):
"""Converts a CSV file to a JSON file."""
data = []
# Read the CSV file
with open(csv_file_path, mode='r', encoding='utf-8') as csv_file:
csv_reader = csv.DictReader(csv_file)
@saibot07
saibot07 / file_reader_writer.py
Created April 19, 2026 12:58
A utility script to read from a text file, process the content, and write the result to another file.
import os
def read_file(file_path):
"""Reads content from a text file."""
if not os.path.exists(file_path):
raise FileNotFoundError(f"File not found: {file_path}")
with open(file_path, 'r') as file:
return file.read()
def process_content(content):
@saibot07
saibot07 / random_password_generator.py
Created April 19, 2026 12:39
Generates a secure random password based on user-defined length and complexity.
import random
import string
def generate_password(length=12, use_special_chars=True):
"""Generates a random password with the specified length and options."""
if length < 4:
raise ValueError("Password length must be at least 4 characters.")
# Define character pools
letters = string.ascii_letters
@saibot07
saibot07 / test.py
Created April 19, 2026 12:37
Test gist
# test