[Tutor] putting accent on letters while user is typing in Entrybox (Tkinter)

Alan Gauld alan.gauld at yahoo.co.uk
Sun Jul 15 19:42:29 EDT 2018

On 15/07/18 20:44, Ali M wrote:
> Hi. I want to write these (ĝ, ĉ, ĵ, ĥ, ŭ, ĉ) accented letters when the user
> types (gx, cx, jx, ux, cx).
> when user types 'gx' for example i want to remove that x and replace it
> with the accent. how should i do that? and how should i specify which
> accent goes above which letter? thanks.

You need to replace the two characters with a single unicode
character representing the accented character.

But you also need to be displaying your output on a device
or terminal capable of displaying the unicode characters.

Mapping a pair of characters to a single unicode one is
not particularly difficult, although not trivial either.

But its rarely necessary. If we knew more about what you
really want to do rather tan what you think is the solution
we might be able to offer more specific help.

Where are you reading the input from?
Where are you displaying the output?
How do you read the input?
How do you display the output?

Why can the user not just type the accented code into
the input?

Alan G
Author of the Learn to Program web site
Follow my photo-blog on Flickr at:

More information about the Tutor mailing list