Helping bot(simple)
Advantages
- The program are opening very fast than manual methods
- I searching time of some data got reduced it just open a new tab in browser if browser is not open quickly opens it for me and
quickly 😜 I can find my search results in Google search engine. - The program files are opening much faster and that is what I need ☺️😛
- It could also take screen shots for me I just wanted to click on button it automatically saves it in jpg formate
Disadvantage:
- It is only command base not verbal base
- It could not search in my computer for files .
- Not user friendly 😝
Python code of my helping bot for pc
import os
import tkinter
import pyperclip
import webbrowser
import requests
import bs4
import pyautogui
commands={
'destroy':'screen.destroy()',
'chintu': "os.startfile('d:/chintu/')",
'cmd': "os.startfile(r'C:\Windows\system32\cmd.exe')",
'control panel'or 'cp':"os.startfile(r'C:\Windows\system32\control.exe')",
"ps": "os.startfile(r'C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe')",
"notepad":"os.startfile(r'C:\Windows\system32\notepad.exe')",
"msword":"os.startfile(r'C:\Program Files (x86)\Microsoft Office\Office12\WINWORD.EXE')",
"execel":"os.startfile(r'C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Office\Microsoft Office Excel 2007.lnk')",
"power point":"os.startfile(r'C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Office\Microsoft Office PowerPoint 2007.lnk')"
}
def click():
#commands
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()
elif mess.get()[0] == 'o':
webbrowser.open(str('http:/www.'+mess.get()[1:]))
elif mess.get()[0]=='s':
webbrowser.open(str('https://www.google.com/search?q='+mess.get()[2:]))
elif mess.get()=='restart':
screen.destroy()
elif mess.get()[0]=="c":
def paste():
pyperclip.copy(str(mess.get()[1:]))
pyperclip.waitForPaste()
tkinter.Button(screen,text=str(mess.get()[1:]),command=paste).pack()
else:
tkinter.Label(screen,text='not exist',).pack()
screen=tkinter.Tk()
screen.title('Message box')
tkinter.Label(screen,text='Message box',).pack()
mess=tkinter.StringVar()
entry=tkinter.Entry(screen,text='Entry',textvariable=mess).pack()
message=mess.get()
submit=tkinter.Button(screen,text='submit',fg='yellow',background='blue',activebackground='green',command=click).pack()
tkinter.mainloop()

No comments:
Post a Comment