---
title: Draw your initials in Paint with PyAutoGUI!
description: Draw your initials in Paint with PyAutoGUI!
---

[Skip to content](https://www.connysoderholm.com/blog/draw-initials-paint-pyautogui#main-content)

![Conny-Söderholm](https://www.connysoderholm.com/hubfs/Conny-S%C3%B6derholm.svg)

- [Home](https://www.connysoderholm.com/)
- [Courses](https://www.connysoderholm.com/courses)
- [Articles](https://www.connysoderholm.com/blog)
- [Contact Me](https://www.connysoderholm.com/contact-me)

Open main navigation

Close main navigation

- [Home](https://www.connysoderholm.com/)
- [Courses](https://www.connysoderholm.com/courses)
- [Articles](https://www.connysoderholm.com/blog)
- [Contact Me](https://www.connysoderholm.com/contact-me)

 June 19, 2018

# Draw your initials in Paint with PyAutoGUI!

![Picture of Conny Söderholm](https://app.hubspot.com/settings/avatar/c60eb763b898c1f4c2e54f9401f3aef1) [Conny Söderholm](https://www.connysoderholm.com/blog/author/conny-soderholm)

Share: [facebook-f icon](http://www.facebook.com/share.php?u=https://www.connysoderholm.com/blog/draw-initials-paint-pyautogui) [linkedin-in icon](http://www.linkedin.com/shareArticle?mini=true&url=https://www.connysoderholm.com/blog/draw-initials-paint-pyautogui) [Twitter icon](https://twitter.com/intent/tweet?url=https://www.connysoderholm.com/blog/draw-initials-paint-pyautogui) [pinterest-p icon](http://pinterest.com/pin/create/link/?url=https://www.connysoderholm.com/blog/draw-initials-paint-pyautogui) [envelope icon](mailto:?body=https://www.connysoderholm.com/blog/draw-initials-paint-pyautogui)

*Draw your initials in Paint with PyAutoGUI!* - Do you like drawing your initials? Did you know you can do it without much labor using Python? Even better that you can do it in Paint? Read on to find out how.

First, install [PyAutoGUI](https://pyautogui.readthedocs.io/en/latest/index.html). The code begins with starting Paint (Admit it, Paint still rocks). We start Paint with the os module, by defining our paint\_path to be "C:\\WINDOWS\\system32\\mspaint.exe". We then have to wait a bit, in order to have time to start up Paint. Now we are ready to start drawing on the screen. We loop the number of times that we want to draw our initials.

I used my initials, COS. The draw\_my\_initials function accepts the variables text\_size and space\_size. Text\_size determines the size of our text and space\_size how much space we want between the letters. We use PyAutoGUI's methods mouseDown and Mouseup to simulate mouse clicks. The MoveRel method takes the relative offset from your mouse pointers current position and moves it the specified X and Y amount. Below is a picture of how it looks like after running once. Make sure that you have a brush or similar selected in Paint. You can see how it looks like on [Youtube](https://youtu.be/9cVGu02-sPs) also.

```
#!python3
import pyautogui
import os
import time
def draw_my_initials(text_size, space_size):
    """
    Draws the initials COS onto the screen.
    """
    # Start drawing
    pyautogui.mouseDown()
    # Draw the letter C
    pyautogui.moveRel(text_size, 0)
    pyautogui.moveRel(0, -text_size)
    pyautogui.moveRel(-text_size, 0)
    # Make a space
    pyautogui.mouseUp()
    pyautogui.moveRel(space_size, 0)
    # Draw the letter O
    pyautogui.mouseDown()
    pyautogui.moveRel(0, text_size)
    pyautogui.moveRel(-text_size, 0)
    pyautogui.moveRel(0, -text_size)
    pyautogui.moveRel(text_size, 0)
    pyautogui.mouseUp()
    pyautogui.moveRel(-text_size, 0)
    # Make a space
    pyautogui.moveRel(space_size, 0)
    # Draw the letter S
    pyautogui.mouseDown()
    pyautogui.moveRel(-text_size, 0)
    pyautogui.moveRel(0, text_size/2)
    pyautogui.moveRel(text_size, 0)
    pyautogui.moveRel(0, text_size/2)
    pyautogui.moveRel(-text_size, 0)
    # All done, release mouse button
    pyautogui.mouseUp()
if __name__ == "__main__":
    text_size = -50
    space_size = 20
    # open paint
    paint_path = "C:\WINDOWS\system32\mspaint.exe"
    os.startfile(paint_path)
    # wait for paint to start
    time.sleep(2)
    # Start drawing
    for i in range(4): # Amount of initials
        draw_my_initials(text_size, space_size)
        pyautogui.moveRel(-text_size, text_size - space_size)
```

Happy coding, and please tell me if you did draw your initials as well!

[Python](https://www.connysoderholm.com/blog/tag/python)

## Related posts

[![Excel table](https://www.connysoderholm.com/hs-fs/hubfs/image-png.png?height=200&name=image-png.png)](https://www.connysoderholm.com/blog/inserting-rows-into-excel-table-without-corrupting-the-table)

[Python](https://www.connysoderholm.com/blog/tag/python), [openpyxl](https://www.connysoderholm.com/blog/tag/openpyxl), [Excel](https://www.connysoderholm.com/blog/tag/excel)

## [Inserting rows into Excel table without corrupting the table](https://www.connysoderholm.com/blog/inserting-rows-into-excel-table-without-corrupting-the-table)

![Picture of Conny Söderholm](https://app.hubspot.com/settings/avatar/c60eb763b898c1f4c2e54f9401f3aef1) [Conny Söderholm](https://www.connysoderholm.com/blog/author/conny-soderholm) 

 August 1, 2023

Inserting rows With OpenPyXL you can insert rows into a worksheet with the worksheet method...

[Read more](https://www.connysoderholm.com/blog/inserting-rows-into-excel-table-without-corrupting-the-table)

[Python](https://www.connysoderholm.com/blog/tag/python), [pypdf2](https://www.connysoderholm.com/blog/tag/pypdf2)

## [Searching for text in PDF files with pypdf2](https://www.connysoderholm.com/blog/search-pdf-files-with-pypdf2)

![Picture of Conny Söderholm](https://app.hubspot.com/settings/avatar/c60eb763b898c1f4c2e54f9401f3aef1) [Conny Söderholm](https://www.connysoderholm.com/blog/author/conny-soderholm) 

 June 29, 2018

Searching for text in PDF files with pypdf2 Portable Document Format (PDF) is wonderful as long as...

[Read more](https://www.connysoderholm.com/blog/search-pdf-files-with-pypdf2)

[Python](https://www.connysoderholm.com/blog/tag/python), [pypdf2](https://www.connysoderholm.com/blog/tag/pypdf2)

## [Rotate PDF files with PyPdf2 and Tkinter!](https://www.connysoderholm.com/blog/rotate-pdf-files-with-pypdf2-and-tkinter)

![Picture of Conny Söderholm](https://app.hubspot.com/settings/avatar/c60eb763b898c1f4c2e54f9401f3aef1) [Conny Söderholm](https://www.connysoderholm.com/blog/author/conny-soderholm) 

 January 24, 2020

Rotating PDF files with PyPDF2 and Tkinter Introduction Sometimes we need simple tools to get the...

[Read more](https://www.connysoderholm.com/blog/rotate-pdf-files-with-pypdf2-and-tkinter)

[linkedin-in icon](https://www.linkedin.com/in/connysoderholm) [Follow us on Facebook](https://www.youtube.com/@connysoderholm1473)

- [Home](https://www.connysoderholm.com)
- [Courses](https://www.connysoderholm.com/courses)
- [Articles](https://www.connysoderholm.com/blog)
- [Contact Me](https://www.connysoderholm.com/contact-me)
- [Privacy Policy](https://www.connysoderholm.com/privacy-policy)
- [Disclaimer](https://www.connysoderholm.com/disclaimer)

---

[![Conny Söderholm Logo](https://www.connysoderholm.com/hubfs/Conny-S%C3%B6derholm.svg "Conny Söderholm Logo")](http://Conny%20Söderholm)

Copyright © 2026 Conny Söderholm

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Conny Söderholm",
    "url" : "https://www.connysoderholm.com/blog/author/conny-soderholm"
  },
  "dateModified" : "2023-07-26T14:39:24.826Z",
  "datePublished" : "2018-06-19T16:38:42.000Z",
  "headline" : "Draw your initials in Paint with PyAutoGUI!",
  "mainEntityOfPage" : {
    "@id" : "https://www.connysoderholm.com/blog/draw-initials-paint-pyautogui",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "url" : "https://www.connysoderholm.com/hubfs/Conny-S%C3%B6derholm.svg"
    },
    "name" : "Conny Söderholm"
  }
}
```