Tkinter GUI Programming by Example: Learn to create modern GUIs using Tkinter by building real-world projects in Python by David Love

Tkinter GUI Programming by Example: Learn to create modern GUIs using Tkinter by building real-world projects in Python by David Love

Author:David Love [Love, David]
Language: eng
Format: epub
Publisher: Packt Publishing
Published: 2018-04-24T22:00:00+00:00


start = end

idx = self.text_widget.search(regex, start, stopindex=tk.END,

regexp=1, count=length)

Now that we have this function, we can add two more lines to the end of our highlight method:

self.highlight_regex(r"[\'][^\']*[\']", "string")

self.highlight_regex(r"[\"][^\']*[\"]", "string")

These regexes can be broken down as follows:

[\"]: Match the string opening character (")

[^\"]*: Match any number of characters which are not the string-closing character

[\"]: Match the string-closing character



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.