title: Python script to open Notepad and write with pyautogui lib
body: <p>I'm trying to create a script to open a webpage and to type stuff there, but first I wanted to try to do it using Notepad</p>
  
  <pre><code>import time
  import os
  import webbrowser
  import pyautogui
  
  os.system("notepad.exe")
  #time.sleep(3)
  pyautogui.write('Hello world!', interval=0.25)
  </code></pre>
  
  <p>This is what I have so far. The problem is that it only opens the Notepad and only after I close the Notepad, 'Hello world!' is printed on my terminal where I'm running the script.</p>
  
  <p>What am I missing here? Is there any other way to write text with a python script?</p>
  
  <p>Thanks!</p>