Automation

A shared tag with AI prompts and code snippets

From workspace: Python

Team: Main

Total snippets: 13

Python

Automation

13 snippets

Autonomous Taxi Agent

# -*- coding: utf-8 -*- """ Created on Fri Jun 4 18:02:01 2021 @author: Ayush """ import time import random import gym import numpy as np from IPython.display import clear_output env = gym.make('Taxi-v3') episodes = 10 for episode in range(1,...

Automatic Spelling Checker Corrector

# imports import sys from spellchecker import SpellChecker from nltk import word_tokenize # create an instance of the spellchecker spell = SpellChecker() # tokens --> stores the tokenized words tokens = [] def...

Automatic Certificate Generator

# importing packages & modules from PIL import Image, ImageDraw, ImageFont import pandas as pd import os # Implementation to generate certificate df = pd.read_csv('list.csv') font = ImageFont.truetype('arial.ttf', 60) for index, j in...

Automated Data Reporting

import pandas as pd def generate_data_report(data_file_path, report_file_path): df = pd.read_csv(data_file_path) summary_statistics = df.describe() column_means = df.mean() column_max_values = df.max() column_min_values =...

Automated scraper

import sys import requests from bs4 import BeautifulSoup import time def display_content(url, selector): try: # Send a GET request to the URL response = requests.get(url) # Check if the request was successful ...

Automated Script

import os import shutil def automated_backup(source_dir, destination_dir): try: # Check if the source directory exists if not os.path.exists(source_dir): print(f"Source directory '{source_dir}' does not exist.") ...

Automated GoogleSearch using Python

from googlesearch import search import sys class googlesearch: def __init__(self): self.search_count = None self.keyword_to_search = None self.search_results = None def set_search_count(self): # Set the...

Automated Game Testing Framework

import unittest class Game: def __init__(self): self.is_running = False self.score = 0 def start(self): self.is_running = True return "Game started." def play(self, action): if...

Automate Facebook bot

import pyautogui import time import webbrowser from selenium import webdriver from time import sleep from webdriver_manager.chrome import ChromeDriverManager from getpass import getpass LOGIN_URL = 'https://www.facebook.com/login.php' num =...

Auto LinkedIn

from selenium import webdriver # connect python with webbrowser-chrome from selenium.webdriver.common.keys import Keys import pyautogui as pag def main(): url = "http://linkedin.com/" # url of LinkedIn network_url =...

Auto Fill Google Forms

import csv import time from selenium import webdriver from selenium.webdriver.common.keys import Keys inputName = '/html/body/div/div[2]/form/div[2]/div/div[2]/div[1]/div/div/div[2]/div/div[1]/div/div[1]/input' inputEmailID =...

Auto Backup

""" Simple backup script which just creates the root structure in an other folder and syncs everything which recursively lies within one of the source folders. For files bigger than a threshold they are first gziped.""" import argparse import...

Auto B'Day Wisher

# Pandas library is used for importing and reading the data import pandas as pd # datetime module is used for fetching the dates import datetime import smtplib # smtp library used for sending mail import os current_path =...