Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I'm new please help
#1
Hello I don't know much about this cool python thing but I did like a thing that I've stolen from the internet somewhere, this is what I've stolen from the internet:

import time
import pyautogui

def SendScript():
	time.sleep(2)
	with open('script.txt') as f:
		lines = f.readlines()
	for line in lines:
		pyautogui.typewrite(line.strip())
		pyautogui.press('enter')

 
SendScript()
I tried to make that the messages don't send directly after each other but I want to make it so another thing sends like 5 seconds after the other how do I do that thanks
buran write Nov-29-2020, 12:05 PM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
Reply
#2
Look up the time.sleep function
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020