Python Forum
macron on top of uppercase letters
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
macron on top of uppercase letters
#4
(Aug-21-2019, 03:31 AM)woooee Wrote: I think it depends on the encoding the OS uses. From the Unicode HOWTO https://docs.python.org/3/howto/unicode.html
Quote:Python supports writing source code in UTF-8 by default, but you can use almost any encoding if you declare the encoding being used. This is done by including a special comment as either the first or second line of the source file:

#!/usr/bin/env python
# -*- coding: latin-1 -*-

u = 'abcdé'
print(ord(u[-1]))

Hi!

Thanks for your prompt (no pun intended Big Grin ) answer!

It might be due to the OS... I have no idea. I'm using Windows 10, 64 bits.

From your attached image, it seems a bit too complicated for my newbie status. I can only partially understand that somehow, you are using (in the example) the (sub)set of latin-1 characters, that you have a string named 'u' and that you made a statement of some sort for printing it, but I would have no idea about the bin, ord (maybe ordering?) or the -1 thingies...

The print command I used in my calculator program (adding the string of the uppercase letter and the combining character of the macron), works just fine there, although not in the Python 3.7.4 Shell... Before trying it directly in the application, I was really frustrated with the solutions provided in many places I checked. I thought that I was mistyping something, as they were not doing in the shell what they supposedly had to do, so I started to copy and paste those commands to my shell. When copying and pasting was not sorting the problem out either, I started to think that maybe the problem was that those solutions were for Python 2 and not for Python 3, so I concentrated on those posts specific to Python 3...

Anyway, enough of my rumblings... Thanks again for your time and help!
newbieAuggie2019

"That's been one of my mantras - focus and simplicity. Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains."
Steve Jobs
Reply


Messages In This Thread
RE: macron on top of uppercase letters - by woooee - Aug-21-2019, 03:31 AM
RE: macron on top of uppercase letters - by newbieAuggie2019 - Aug-21-2019, 08:06 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  AttributeError: module 'string' has no attribute 'uppercase' Anldra12 10 10,597 Apr-23-2021, 05:30 PM
Last Post: ibreeden
  Python uppercase conversion conditions Jaypeng 7 3,135 Apr-29-2020, 11:24 AM
Last Post: jefsummers
  'True' if 'string' has at least one uppercase letter ClassicalSoul 1 3,425 Feb-28-2019, 12:08 PM
Last Post: buran
  check if value of passed variable has uppercase characters in it. wfsteadman 3 3,340 Sep-01-2017, 05:52 PM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020