This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
with open('file.csv', 'r') as csvfile: | |
csvreader = csv.reader(csvfile) | |
for row in csvreader: | |
print(row) |