Skip to content

Instantly share code, notes, and snippets.

View linuxinsights's full-sized avatar

Linux Tech linuxinsights

View GitHub Profile
import csv
with open('file.csv', 'r') as csvfile:
csvreader = csv.reader(csvfile)
for row in csvreader:
print(row)
@linuxinsights
linuxinsights / send_telegram_notification.py
Last active April 16, 2024 04:10
How to send Alerts and Notifications with Telegram Python| Detailed How to article: https://linuxtech.in/how-to-send-alerts-and-notifications-with-telegram/
import requests
def send_telegram_notification(bot_token, chat_id, message):
url = f"https://api.telegram.org/bot{bot_token}/sendMessage"
payload = {
'chat_id': chat_id,
'text': message
}
response = requests.post(url, data=payload)
if response.status_code == 200:
import argparse
import os
import shutil
def sort_files_on_desktop(desktop_path):
# Create a dictionary mapping file extensions to folder names
folder_names = {
".txt": "Text Files",
".pdf": "PDFs",
".doc": "Word Documents",