Re: print('\N{flag: Mauritius}') not supported in py3.9

2021-12-21 Thread boB Stepp

On 21/12/22 12:14PM, Python wrote:

On 30/11/2021 12.31, Cameron Simpson wrote:

On 30Nov2021 10:59, DL Neil  wrote:

...


I've nominated Kitty as
Fedora's default terminal. We'll see how it goes with work-loads beyond
raising the flag...


I'd like to hear how that goes down the track. If I find myself on a
Linux desktop again a good terminal emulator would be very welcome.



(given that @A-R has brought this thread back-to-life)


I have been surprised/shocked/horrified/annoyed to discover that the
(Linux) clipboard is not accessible from "Kitty".


Huh?  I use kitty and copy to and from the clipboard all the time.
1) ctrl+shift+c Copy to clipboard
2) ctrl+shift+v Paste from the clipboard
3) Using mouse to select text automatically copies it to the primary 
clipboard.
4) Middle-click of mouse to paste from the primary clipboard.


--
Wishing you only the best,
boB Stepp

Speeches are like steer horns -- a point here, a point there and a lot of bull
in between.
-- E. Anderson
--
https://mail.python.org/mailman/listinfo/python-list


Re: print('\N{flag: Mauritius}') not supported in py3.9

2021-12-21 Thread dn via Python-list
On 30/11/2021 12.31, Cameron Simpson wrote:
> On 30Nov2021 10:59, DL Neil  wrote:
...

>> I've nominated Kitty as
>> Fedora's default terminal. We'll see how it goes with work-loads beyond
>> raising the flag...
> 
> I'd like to hear how that goes down the track. If I find myself on a 
> Linux desktop again a good terminal emulator would be very welcome.


(given that @A-R has brought this thread back-to-life)


I have been surprised/shocked/horrified/annoyed to discover that the
(Linux) clipboard is not accessible from "Kitty".

Go on, I dare you to remind me that good-old 'dumb-terminals' didn't
have 'clipboards'...
(neither did they have to cope with Unicode, emoticons, or national flags!)


Accordingly, having developed an idea in the REPL (running within
Kitty), could not later copy-paste into a Python module or tutorial text
(nor, next time the situation arises, to be able to illustrate an answer
to a question posted 'here').

Am somewhat in disbelief, and my fingers feel slightly singed. Grump!
(or its seasonal variation: "Grinch")


Am open to further non-terminal, terminal suggestions...

(during my post-op recovery period, am hoping to experiment with another
Linux distro (and Window Manager), which may alter the playing-field...)


Meantime, casting-off the terminal-Grinch, compliments of the season to
you...
-- 
Regards,
=dn
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PyCharm settings - per: print('\N{flag: Mauritius}') not supported in py3.9

2021-12-21 Thread Abdur-Rahmaan Janhangeer
Yet another unicode issue XD

Kind Regards,

Abdur-Rahmaan Janhangeer
about  | blog

github 
Mauritius
-- 
https://mail.python.org/mailman/listinfo/python-list


PyCharm settings - per: print('\N{flag: Mauritius}') not supported in py3.9

2021-12-01 Thread dn via Python-list
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
>>  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
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: print('\N{flag: Mauritius}') not supported in py3.9

2021-11-29 Thread Cameron Simpson
On 30Nov2021 10:59, DL Neil  wrote:
>Fedora names it as rxvt-unicode.
>Installed v9.26
>Text is too small for these old eyes.

Fair enough. There are resources, but not worth it unless you really 
want the app.

>No menu bar and no context menus.

Um, yes. The (hardware, serial) terminals we had a uni didn't have such 
niceties, and therefore we should not want them.

>Unable to copy-paste (the flag codes) into that window.
>Removed.

Fair enough.

>I choose not to even try to remember the difficulties of working with
>small screens over-laying one another and 'getting lost' in the pile!

Aye. Tiling is very nice.

>I'm a lazy toad. Thus the idea that the IDE will allow me to 'press a
>(single) button' to repeat the last-run test/execute the code, without
>me having to commit a Save and to jump between panels/windows/screens,
>is seductive.

I once had a vi macro bound to ";" for "^W:!!^M", which autosaves the 
current file and reran the last shell command. Used it a lot in the 
single-terminal days. I unbound it several years ago though.

>I've nominated Kitty as
>Fedora's default terminal. We'll see how it goes with work-loads beyond
>raising the flag...

I'd like to hear how that goes down the track. If I find myself on a 
Linux desktop again a good terminal emulator would be very welcome.

Cheers,
Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: print('\N{flag: Mauritius}') not supported in py3.9

2021-11-29 Thread dn via Python-list
On 30/11/2021 10.19, Cameron Simpson wrote:
> On 29Nov2021 22:25, DL Neil  wrote:
 Probably a font issue. Not many fonts support the flags.
>>>
>>> Agree about the font support. Some terminal emulators make an effort to
>>> have fallback fonts for when your preferred font lacks a glyph. IIRC
>>> urxvt is such a terminal on Linux.
>>
>> Not sure about this. Most other applications on this PC will display the
>> two countries' flags, as desired, eg Writer, web-browser, even xed
>> (basic text editor).
> 
> Seem Stefan Ram's advice, which points out that you can tell if this is 
> a font problem (no flag glyph) or a combining problem (2 glyphs 
> presented instead of one). I had not considered that.

@Stefan's advice preceded by report that two glyphs were printed (not
one): "the two letters "N" and "Z" are shown with dotted-outlines"
(I think, the UTF-16 decoding)


>> rxvt: won't compile, gave-up fighting unfamiliar requirements
> 
> See if there's a package for urxvt, which was the "unicode" flavour of 
> rxvt (long ago - rxvt if probably supposed to be unicode capable these 
> days, surely).

Fedora names it as rxvt-unicode.
Installed v9.26
Text is too small for these old eyes.
No menu bar and no context menus.
Unable to copy-paste (the flag codes) into that window.
Removed.


>> Kitty: works!
> 
> Yay!
> 
>> Kitty is not something I've come-across before. Its write-up says
>> «
>> Kitty is a free, open-source, and fast, feature-rich, GPU accelerated
>> terminal emulator for Linux, that supports all present-day terminal
>> features, such as Unicode, true color, text formatting, bold/italic
>> fonts, tiling of multiple windows and tabs, etc.
> 
> A tiling terminal emulator can be a great thing. I'm on a Mac with 
> iTerm, which:
> - has tabs
> - has panes (split the view into multiple panels, each running a 
>   terminal)
> 
> My personal dev desktop tends to use a full screen iTerm split 
> vertically into 2 panes: an editor on the left (vim, itself split 
> vertically into 2 vim windows) and a shell on the right; sometimes 
> several shells (right hand pane further split horizontally).
> 
> Then, since I tend to keep per-branch checkouts around, tabs for the 
> things I'm working on, each configured as above. Then I just switch tabs 
> for the different areas.


Yes, a good way to work. Neatly explained.

I choose not to even try to remember the difficulties of working with
small screens over-laying one another and 'getting lost' in the pile!

My desktop/dev.svr features two screens: one in 'portrait mode' and the
other 'landscape'. The former is very good for code-listings. The latter
for execution-display, pytest reports, etc. As you describe, each can be
sub-divided when needs-arise. A neat feature is that "Tool Windows" can
be tucked-away, and only 'pulled-out' when required, eg am not looking
at Sourcery's assessments right now (unless it highlights the commission
of some 'crime' as I type) but will check prior to (or as part of) git
commit. The Tool Window's name/label in the 'dock' also forms a reminder
that I shouldn't (totally) neglect my responsibilities!

These are managed within the IDE - sadly, PyCharm's terminal/console
fails the 'flag test', as reported yesterday. (am not sure if one might
be able to select which terminal emulator to use ...)

I'm a lazy toad. Thus the idea that the IDE will allow me to 'press a
(single) button' to repeat the last-run test/execute the code, without
me having to commit a Save and to jump between panels/windows/screens,
is seductive.

Don't tell my trainees! Every course sees three or four who 'cry for
help' because making some change in their choice of editor/IDE does not
result in similar within the web-browser. Did you forget to save the
source, Luke? That's not to say there won't be considerably more who
manage to diagnose the problem without admitting such to 'the outside
world'!


There are times when there is no need to (wait quite a while to) boot-up
a whole IDE, eg running a utility program. I've nominated Kitty as
Fedora's default terminal. We'll see how it goes with work-loads beyond
raising the flag...
Salute!
-- 
Regards,
=dn
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: print('\N{flag: Mauritius}') not supported in py3.9

2021-11-29 Thread Cameron Simpson
On 29Nov2021 22:25, DL Neil  wrote:
>>> Probably a font issue. Not many fonts support the flags.
>>
>> Agree about the font support. Some terminal emulators make an effort to
>> have fallback fonts for when your preferred font lacks a glyph. IIRC
>> urxvt is such a terminal on Linux.
>
>Not sure about this. Most other applications on this PC will display the
>two countries' flags, as desired, eg Writer, web-browser, even xed
>(basic text editor).

Seem Stefan Ram's advice, which points out that you can tell if this is 
a font problem (no flag glyph) or a combining problem (2 glyphs 
presented instead of one). I had not considered that.

>rxvt: won't compile, gave-up fighting unfamiliar requirements

See if there's a package for urxvt, which was the "unicode" flavour of 
rxvt (long ago - rxvt if probably supposed to be unicode capable these 
days, surely).

>Kitty: works!

Yay!

>Kitty is not something I've come-across before. Its write-up says
>«
>Kitty is a free, open-source, and fast, feature-rich, GPU accelerated
>terminal emulator for Linux, that supports all present-day terminal
>features, such as Unicode, true color, text formatting, bold/italic
>fonts, tiling of multiple windows and tabs, etc.

A tiling terminal emulator can be a great thing. I'm on a Mac with 
iTerm, which:
- has tabs
- has panes (split the view into multiple panels, each running a 
  terminal)

My personal dev desktop tends to use a full screen iTerm split 
vertically into 2 panes: an editor on the left (vim, itself split 
vertically into 2 vim windows) and a shell on the right; sometimes 
several shells (right hand pane further split horizontally).

Then, since I tend to keep per-branch checkouts around, tabs for the 
things I'm working on, each configured as above. Then I just switch tabs 
for the different areas.

Cheers,
Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: print('\N{flag: Mauritius}') not supported in py3.9

2021-11-29 Thread dn via Python-list
On 29/11/2021 12.06, Cameron Simpson wrote:
> On 29Nov2021 09:19, Chris Angelico  wrote:
>> On Mon, Nov 29, 2021 at 8:10 AM dn via Python-list
>>  wrote:
>>> 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".
>>>
>>> Whereas here in email (Thunderbird) or in a web-browser, the flags
>>> appear, as desired.
>>>
>>> Is this a terminal short-coming (locale charmap -> UTF-8 - which brings
>>> to mind the old UCS-4 questions), a font issue, or what (to fix)?
>>
>> Probably a font issue. Not many fonts support the flags.
> 
> Agree about the font support. Some terminal emulators make an effort to 
> have fallback fonts for when your preferred font lacks a glyph. IIRC 
> urxvt is such a terminal on Linux.


Not sure about this. Most other applications on this PC will display the
two countries' flags, as desired, eg Writer, web-browser, even xed
(basic text editor).

Accordingly, took @Cameron's advice. Leading to:

Gnome Terminal: won't display "\U0001F1F3\U0001F1FF" (etc)
Terminator: won't display
Tabby: doesn't seem to load from (rpm) repo
RoxTerm: no choice of fonts, won't display
rxvt: won't compile, gave-up fighting unfamiliar requirements
Terminology: offers choice of fonts, but still fails

Kitty: works!


Kitty is not something I've come-across before. Its write-up says
«
Kitty is a free, open-source, and fast, feature-rich, GPU accelerated
terminal emulator for Linux, that supports all present-day terminal
features, such as Unicode, true color, text formatting, bold/italic
fonts, tiling of multiple windows and tabs, etc.

Kitty is written in C and Python programming languages, and it is one of
few terminal emulators with GPU support
»


Yes, the one that 'works', is using the same fonts as (say) Writer, and
the original (Gnome) Terminal that fails.


Please don't take this as a scientific survey. I didn't spend any time
investigating - either the s/w worked or it didn't! However, a terminal
is doing a simple job (at the user-level), so there's not much to them
in terms of knobs to twiddle or levers to pull.
-- 
Regards,
=dn
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: print('\N{flag: Mauritius}') not supported in py3.9

2021-11-28 Thread Cameron Simpson
On 29Nov2021 09:19, Chris Angelico  wrote:
>On Mon, Nov 29, 2021 at 8:10 AM dn via Python-list
> wrote:
>> 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".
>>
>> Whereas here in email (Thunderbird) or in a web-browser, the flags
>> appear, as desired.
>>
>> Is this a terminal short-coming (locale charmap -> UTF-8 - which brings
>> to mind the old UCS-4 questions), a font issue, or what (to fix)?
>
>Probably a font issue. Not many fonts support the flags.

Agree about the font support. Some terminal emulators make an effort to 
have fallback fonts for when your preferred font lacks a glyph. IIRC 
urxvt is such a terminal on Linux.

Cheers,
Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: print('\N{flag: Mauritius}') not supported in py3.9

2021-11-28 Thread Chris Angelico
On Mon, Nov 29, 2021 at 8:10 AM dn via Python-list
 wrote:
> 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".
>
> Whereas here in email (Thunderbird) or in a web-browser, the flags
> appear, as desired.
>
> Is this a terminal short-coming (locale charmap -> UTF-8 - which brings
> to mind the old UCS-4 questions), a font issue, or what (to fix)?

Probably a font issue. Not many fonts support the flags.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: print('\N{flag: Mauritius}') not supported in py3.9

2021-11-28 Thread dn via Python-list
On 29/11/2021 02.18, Chris Angelico wrote:
> On Mon, Nov 29, 2021 at 12:10 AM Abdur-Rahmaan Janhangeer
>  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".

Whereas here in email (Thunderbird) or in a web-browser, the flags
appear, as desired.

Is this a terminal short-coming (locale charmap -> UTF-8 - which brings
to mind the old UCS-4 questions), a font issue, or what (to fix)?
-- 
Regards,
=dn
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: print('\N{flag: Mauritius}') not supported in py3.9

2021-11-28 Thread Abdur-Rahmaan Janhangeer
Greetings,


But why is it so?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: print('\N{flag: Mauritius}') not supported in py3.9

2021-11-28 Thread Chris Angelico
On Mon, Nov 29, 2021 at 12:29 AM Abdur-Rahmaan Janhangeer
 wrote:
>
> Greetings,
>
> I get you but why do the short names work for some and not for
> others?
>

Which ones work? The ones that can be identified by a single
codepoint? Look at the specification for Python's \N escapes.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: print('\N{flag: Mauritius}') not supported in py3.9

2021-11-28 Thread Abdur-Rahmaan Janhangeer
Greetings,

I get you but why do the short names work for some and not for
others?

Kind Regards,

Abdur-Rahmaan Janhangeer
about  | blog

github 
Mauritius
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: print('\N{flag: Mauritius}') not supported in py3.9

2021-11-28 Thread Chris Angelico
On Mon, Nov 29, 2021 at 12:10 AM Abdur-Rahmaan Janhangeer
 wrote:
> I found the whole CLDR short name here:
> https://unicode.org/emoji/charts/full-emoji-list.html
>
> However when i do
>
> >>> print('\N{flag: Mauritius}')
>   File "", line 1
> print('\N{flag: Mauritius}')
>^
> i get
>
> SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in
> position 0-18: unknown Unicode character name
>
> So is it that Python3.9 does not support it or what is the issue here?

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}"
''

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


print('\N{flag: Mauritius}') not supported in py3.9

2021-11-28 Thread Abdur-Rahmaan Janhangeer
Mike Driscoll printed this on Twitter

>>> print('\N{Sauropod}')
秊

Using py3.9 i got the above.

I found the whole CLDR short name here:
https://unicode.org/emoji/charts/full-emoji-list.html

However when i do

>>> print('\N{flag: Mauritius}')
  File "", line 1
print('\N{flag: Mauritius}')
   ^
i get

SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in
position 0-18: unknown Unicode character name

So is it that Python3.9 does not support it or what is the issue here?
Thanks

Kind Regards,

Abdur-Rahmaan Janhangeer
about  | blog

github 
Mauritius
-- 
https://mail.python.org/mailman/listinfo/python-list