Auto send Messages Pyautogui
import pyautogui
import time
text = 'I Love Python'
while True:
time.sleep(3)
pyautogui.typewrite(text)
time.sleep(2)
pyautogui.press("enter")
#run the code and keep the cursor where you want to write message
import pyautogui
import time
text = 'I Love Python'
counter =3
while counter > 0:
time.sleep(1)
pyautogui.typewrite(text)
time.sleep(1)
pyautogui.press("enter")
counter -= 1
#Pyauto new topics
from tkinter import Button
import pyautogui
ask = pyautogui.confirm(text = 'would you Like to login?',title = 'Alert', buttons =['Yes','No'])
if ask == 'Yes':
username = pyautogui.prompt(title='username',text='please enter your username',default='username')
password = pyautogui.password(title = 'password', text='please enter your password',mask='*')
elif ask == 'No':
alert = pyautogui.confirm(title='Alert', text='r u sure?', buttons=['Yes','No'])
if alert == 'Yes':
print("user choose not to login ")
quit()
elif alert == 'No':
print('please Try again!!')
quit()
print(f"username : {username}")
print(f"password : {password}")
#screen shot
import pyautogui
pyautogui.screenshot('jagg.png')
import pyautogui
pyautogui.screenshot('jagg.png',region=(0,0,300,400))
#multi screenshot
import pyautogui
i = 0
while i <= 3:
i += 1
pyautogui.screenshot(f'{i}.png',region=(0,0,300,400))
# browse topic
import pyautogui
pyautogui.write("hello world",interval=0.25)
pyautogui.press("enter")
# box
import pyautogui
pyautogui.alert(text='Alert', title = 'alert box', button = 'ok')
pyautogui.confirm(text='Alert', title = 'alert box', buttons =['ok','cancel'])
pyautogui.prompt(text='input', title = 'input box', default= 'username')
pyautogui.password(text='input', title = 'input box', mask = '*')
Comments
Post a Comment