PyCharm settings - per: print('\N{flag: Mauritius}') not supported in py3.9
dn
PythonList at DancesWithMice.info
Wed Dec 1 18:20:35 EST 2021
On 29/11/2021 10.08, dn via Python-list wrote:
> On 29/11/2021 02.18, Chris Angelico wrote:
>> On Mon, Nov 29, 2021 at 12:10 AM Abdur-Rahmaan Janhangeer
>> <arj.python at gmail.com> wrote:
>>
>> Flags are actually constructed from multiple codepoints. What you want
>> is to insert each codepoint separately. You can see them listed in the
>> second column of the table you linked to.
>>
>>>>> "\U0001F1F2\U0001F1FA"
>> '🇲🇺'
>>
>> To do this with names, you need the names of those two codepoints:
>>
>> '\U0001f1f2' REGIONAL INDICATOR SYMBOL LETTER M
>> '\U0001f1fa' REGIONAL INDICATOR SYMBOL LETTER U
>>
>>>>> "\N{REGIONAL INDICATOR SYMBOL LETTER M}\N{REGIONAL INDICATOR SYMBOL LETTER U}"
>> '🇲🇺'
>
>
> Don't use Emojis that often. The colored circles (U+1F534 etc) display
> in full, glorious, technicolor.
>
> However, when trying the above, with our local flag in (Fedora Linux,
> Gnome) Terminal or PyCharm's Run terminal; the two letters "N" and "Z"
> are shown with dotted-outlines. Similarly, the Mauritius' flag is shown
> as "M" and "U".
Investing a bit of time/waiting for a meeting, found a number of Issues
lodged with JetBrains relating to emoji-support/display:-
Among the most recent advice is to add a "Fallback font" which is known
to include (colored!) emojis.
Thus (this includes personal settings):
File > Settings > Editor > Font
Font = IBM Plex Mono
drop down > Typography Settings
Fallback font = Twemoji
After which, patriotic-pride may be expressed!
However, the Issues (that is to say, those which I had time/energy to
read) indicate that there may still be differences between Linux, Mac,
Windows, and that 'franken-thing' which is Linux on top of Windows but
we don't label it "Linux" so that people still think it is "Windows".
Further wrinkles (drifting OT!):
Fedora 33's Gnome Font Viewer shows:
Emoji One
Noto Color Emoji
Twemoji
- don't ask me the why/when/where of Twemoji
- the other two were added via dnf (yum) today
Neither shows in PyCharm's drop-down list of choices - even after
stop/start (which doesn't appear strictly necessary, per above, but...).
Performed:
fc-cache -fv
and the listing verifies their presence, and ensures all is compos-mentis.
In Writer, all three appear (without prefix). Still only the one appears
in PyCharm. (sigh...)
PS thanks to the OP! Certainly opened my eyes and befuddled (what's left
of) my brain. Was planning to use the aforementioned 'colored circles'
in a PUG coding exercise, but have now amended to require coders to
'wave the flag'. Hopefully they will find such slightly more amusing...
Salute!
--
Regards,
=dn
More information about the Python-list
mailing list