1. Install PYAUTOGUI module.
code - pip install pyautogui
2. Make a folder, in that folder make two files “spam.txt” and “spam.py” (edit these files with notepad or you can use any code editor like visual studio code, pycharm, atom, etc.)
3. In “spam.txt” type messages like
code - hii hello how are you fine what are you doing where are you why are you You can add more messages if you want
4. Copy the below code and paste in “spam.py”
code - import pyautogui import time time.sleep(10) f = open("./spam.txt", "r") for word in f: pyautogui.typewrite(word)