Skip to main content

Enhancing Automation with Python: My Personal Helper Bot for PC


Incorporating this project into one of my automation endeavors has proved highly advantageous. The benefits are numerous, significantly improving my efficiency and experience:

Advantages:

  1. Swift Program Launching:
    The program launches applications swiftly, far quicker than traditional manual methods.

  2. Efficient Data Retrieval:
    The search time for specific data has drastically reduced. It opens a new browser tab swiftly and presents my search results using Google’s search engine.

  3. Speedy File Access:
    Program files open much faster, catering precisely to my needs. Speed is of the essence, and this feature delivers!

  4. Automated Screenshots:
    The program effortlessly captures screenshots on my command, saving them in JPG format. A simple click on a button achieves this task.

Disadvantage:

  • Command-Based Interaction:
    The system operates solely on command input and does not support verbal instructions.

  • Limited File Search Capability:
    The program cannot conduct searches for files within my computer, limiting its scope of operation.

  • Usability Concerns:
    The interface is not particularly user-friendly, necessitating familiarity with the provided commands.

Python Code for My Helper Bot:

import os
import tkinter
import pyperclip
import webbrowser
import requests
import bs4
import pyautogui

commands = {
    'destroy': 'screen.destroy()',
    'chintu': "os.startfile('d:/chintu/')",
    # ... (other commands)
}

# Function to process user input and execute corresponding commands
def click():
    if mess.get() in commands:
        print(eval(commands[mess.get()]))
    elif mess.get() == "screenshot":
        def screenshot():
            a = pyautogui.screenshot()
            a.save(r"C:\Users\HOME\Desktop\screenshot.jpg")
        tkinter.Button(screen, text='screenshot', command=screenshot).pack()
    # ... (other command cases)

# Setting up the GUI and handling user interaction
screen = tkinter.Tk()
screen.title('Message box')
tkinter.Label(screen, text='Message box').pack()
mess = tkinter.StringVar()
entry = tkinter.Entry(screen, textvariable=mess).pack()
submit = tkinter.Button(screen, text='submit', fg='yellow', background='blue', activebackground='green', command=click).pack()

tkinter.mainloop()

Conclusion

Integrating automation into daily routines enhances productivity and simplifies tasks. This helper bot, with its speed and automation capabilities, has become an invaluable asset, streamlining various processes in my computing environment. However, improvements in user-friendliness and expanded search functionalities would further enhance its utility.

Feel free to ask if you need further clarification or if you have any questions! 😊

Comments