PYHON AUTO TYPER
Spread the love

🚀 Free Python Auto Typer Project

By Pearl Institute Batala

This Python Auto Typer project uses pyautogui to automatically open Notepad, type a message with the current date and time, save it on the Desktop with a timestamped filename, and close Notepad. It’s perfect for beginners who want to explore real-world Python automation.

  • ✅ Launches Notepad
  • ✅ Types a dynamic message
  • ✅ Saves the file with current date & time
  • ✅ Logs the operation
  • ✅ Closes Notepad automatically
PYHON AUTO TYPER
PYHON AUTO TYPER

📄 Full Source Code:

import pyautogui
import time
import os
from datetime import datetime
import subprocess

subprocess.Popen(['notepad.exe'])
time.sleep(2)

current_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
message = f"Automated Note\n\nThis message was typed by Python at {current_time}."

pyautogui.write(message, interval=0.05)

pyautogui.hotkey('ctrl', 's')
time.sleep(1)

filename = f"note_{datetime.now().strftime('%Y%m%d_%H%M%S')}.txt"
filepath = os.path.join(os.path.expanduser("~"), "Desktop", filename)

pyautogui.write(filepath)
time.sleep(1)
pyautogui.press('enter')

with open("automation_log.txt", "a") as log:
    log.write(f"{datetime.now()}: Note saved as {filename}\n")

time.sleep(1)
pyautogui.hotkey('alt', 'f4')

📦 How to Run:

  1. Install Python 3.x from python.org
  2. Run: pip install pyautogui
  3. Save the code as autotyper.py
  4. Run: python autotyper.py

🌐 Visit Us:

Pearl Institute Batala — Learn Python, Web Development, Digital Marketing, and more!