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
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to