Python Forum
I'm new please help - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: I'm new please help (/thread-31225.html)



I'm new please help - Nan0Scho1ar - Nov-29-2020

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


RE: I'm new please help - jefsummers - Nov-29-2020

Look up the time.sleep function