Auto Typing Code in Python | just 2 lines

You can automate your typing with just 2 lines of python code and also you can write your online impositions at midnight while you will be sleeping with just two lines of python. Let’s move on to an awesome project.

Before getting into this we will have a python interpreter andPyAutoGUI packages. In this case, I will use pycharm IDE. How to install pycharm in windowshttps://iterathon.tech//how-to-install-the-pycharm-in-windows/

Open New Projects

After opening a pycharm click on a new project and you can give it any name like an Auto Typing code. In this project.

Once you have give the name and click on the create. It takes few seconds to create the project, In the current project (Auto Typing Code) there are some existing files are found in IDE so, delete all those files using Ctrl+A and Backspace. Now Python is ready to code before that we need one awesome python packages called PyAutoGUI.

Install PyautoGUI

Link to PyAutoGUI package: https://pypi.org/project/PyAutoGUI/ . After getting into the link. You need to copy the magical word to install pyAutoGUI. That is pip install PyAutoGUI.

Again go to the pycharm and click terminal then paste the magical word pip install PyAutoGUI. It takes few seconds to install packages. Once the package gets installed and go to your project Auto Typing Code.

Magicial code

To write a some message at specific time or At midnight while you slept use these 2 lines of python code to type automatic message, how many times you want? This is Easy and crazy. Let’s move on

# python code for auto typing

import pyautogui
x = int(input("how many times want to print"))
for i in range(x):
    pyautogui.typewrite(" ITERATHON ", interval = 0.30)

#Output   
how many times want to print3
 ITERATHON  ITERATHON  ITERATHON 

From Practical

If the above code is not working refer with below image

Related Blogs

How to Impress a Girlfriend using python: https://iterathon.tech//how-to-impress-a-girlfriend-using-python/

LEARN MORE ❣