I want to make an interactive tutorial for special textdocuments. I would like to be able to insert text by the program and also have the user to add something.

I would like to have the text appear char by char. I tried this, but it just blocks the window from appearing completely, until the text is written out

import sys
import time
from PyQt5 import QtWidgets as qtw

Qt Code:
  1. class Text_Script(qtw.QTextEdit):
  2. def __init__(self):
  3. super().__init__()
  4.  
  5. def write_intro(self):
  6. welcome_string = "Welcome!"
  7. for i in range(0, len(welcome_string)):
  8. time.sleep(0.2)
  9. self.insertPlainText(welcome_string[i])
To copy to clipboard, switch view to plain text mode 
calling in the main window
Qt Code:
  1. import sys
  2. from Text_Script import Text_Script
  3. from PyQt5 import QtWidgets as qtw
  4.  
  5.  
  6. class Lastenheft(qtw.QWidget):
  7. def __init__(self):
  8. super().__init__()
  9. self.init_me()
  10.  
  11. def init_me(self):
  12. self.setLayout(qtw.QVBoxLayout())
  13. self.text_script = Text_Script()
  14. self.next_btn = qtw.QPushButton("Next")
  15. self.layout().addWidget(self.text_script)
  16. self.layout().addWidget(self.next_btn)
  17. self.showMaximized()
  18. self.text_script.write_intro()
  19.  
  20. if __name__ == '__main__':
  21. app = qtw.QApplication(sys.argv)
  22. mw = Lastenheft()
  23. sys.exit(app.exec())
To copy to clipboard, switch view to plain text mode 

Is there a way to achieve this?