how to write words on any other apps in python

import pyautogui
print(pyautogui.press('I'))

Here is what the above code is Doing:
1. It’s importing the pyautogui module.
2. It’s printing the return value of pyautogui.press(‘I’).
3. It’s pressing the I key.

The pyautogui.press() function takes a string of characters and sends them to the active window.

The string argument is case-sensitive, so make sure to use uppercase characters for keys that require the Shift key to be held down.

For example, the following code presses the Shift key, then the 1 key, then the 2 key, then releases all the keys:

import pyautogui
pyautogui.keyDown(‘shift’)
pyautogui.press(’12’)
pyautogui.keyUp(‘shift’)

You can also press keys by their key code. For example, the following code presses the F1 key:

import pyautogui
pyautogui.keyDown(‘f1’)

You can find a list of key codes at http://www.autohotkey.com/docs/KeyList.htm.

You can also press and hold multiple keys at once. For example, the following code presses and holds the Shift key, then presses and holds the 1 key, then presses and holds the 2 key, then releases all the keys:

import pyautogui
pyautogui.keyDown(‘shift’)
pyautogui.keyDown(‘1’)
pyautogui.keyDown(‘2’)
pyautogui.keyUp(‘1’)
pyautogui.keyUp(‘2’)
pyautogui.keyUp(‘shift’)

You can also press keys by their key code. For example, the following code presses the F1 key:

import pyautogui
pyautogui.keyDown(‘f1’)

You can find a list of key codes at http://www.autohotkey.com/docs/KeyList.htm.

You can also press and hold multiple keys at once. For example, the following code presses and holds the Shift key, then presses and holds the 1 key, then presses and holds the 2 key, then releases all the keys:

import pyautogui
pyautogui.keyDown(‘shift’)
pyautogui.keyDown(‘1’)
pyautogui.keyDown(‘2’)
pyautogui.keyUp(‘1’)
pyautogui.keyUp(‘2’)
pyautogui.keyUp(‘shift’)

You can also press keys by their key code. For example, the following code presses the F1 key:

import pyautogui
pyautogui.keyDown(‘f1’)

You can find a list of key codes at http://www.autohotkey.com/docs/KeyList.htm.

You can also press and hold multiple keys at once. For example, the following code presses and holds the Shift key, then presses and holds the 1 key, then presses and holds the 2 key, then releases all the keys:

import pyautogui
pyautogui.keyDown(‘shift’)
pyautogui.keyDown(‘1’)
pyautogui.keyDown(‘2’)
pyautogui.keyUp(‘1’)
pyautogui.keyUp(‘2’)
pyautogui.keyUp(‘shift’)

You can also press keys by their key code. For example, the following code presses the F1 key:

import pyautogui
pyautogui.keyDown(‘f1’)

You can find a list of key codes at http://www.autohotkey.com/docs/KeyList.htm.

You can also press and hold multiple keys at once. For example, the following code presses and holds the Shift key, then presses and holds the 1 key, then presses and holds the 2 key, then releases all the keys:

import pyautogui
pyautogui.keyDown(‘shift’)
pyautogui.keyDown(‘1’)
pyautogui.keyDown(‘2’)
pyautogui.keyUp(‘1’)
pyautogui.keyUp(‘2’)
pyautogui.keyUp(‘shift’)

You can also press keys by their key code. For example, the following code presses the F1 key:

import pyautogui
pyautogui.keyDown(‘f1’)

You can find a list of key codes at http://www.autohotkey.com/docs