1

I am writing a simple editor program. How can I check the input text? For example, when the input contains "print", re-format it (color, bold, etc). How to check it continuously?

def recognizer(self):
    while True:
        if "word" in self.plainTextEdit.toplainText :
            print("True")
ekhumoro
  • 115,249
  • 20
  • 229
  • 336
Hunterx01
  • 39
  • 7
  • explain yourself better, and give a better example. – eyllanesc Mar 18 '18 at 17:27
  • 1
    It sounds like you may want a [QSyntaxHighlighter](https://doc.qt.io/qt-5/qsyntaxhighlighter.html). Possibly related: https://stackoverflow.com/q/40155268/984421. – ekhumoro Mar 18 '18 at 18:54

0 Answers0