Letters with Accents Not Inputting - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Letters with Accents Not Inputting (/thread-19076.html) |
Letters with Accents Not Inputting - Phylus - Jun-12-2019 LETTERS WITH ACCENTS NOT INPUTTING How do I let the user input at the (Mac) Terminal words with letters with accents? (As in the related thread "Letters with Accents Not Displaying" this is about Python 2.7.10 code in MacOS 10.14.5. Letters display with accents in both my text file (in TextEdit) of Portuguese words and my (Mac) Terminal, both of which are encoded in Unicode (UTF-8).) 1. The simplest try: y = input("Your answer: ")followed by equal comparison with a Unicode list entry results in: 2. The try:y = input("Your answer ",encoding="utf-8")results in: 3. The codecs try (matching the solution in thread "Letters with Accents Not Displaying"):input codecs y = codecs.input("Your answer ",encoding="utf-8")results in: 4. In Python 2 there is another input method raw_input. It fails in the same ways, for example:input codecs y = codecs.raw_input("Your answer ",encoding="utf-8")results in: Can anyone point me in the direction of how to let the user input at a (Mac) Terminal words with letters with accents please?
|