Aug-20-2019, 11:24 PM
I'm having problems displaying a macron on top of uppercase (or if you prefer, capital or mayuscule) letters (for Roman numerals) in Python 3.7.4
Hi, I’m starting to learn Python, so I would appreciate your explanations like you would explain things to a kid. I’m using Python 3.7.4.
I want to represent the number 4000 in Roman numbers by putting a macron (a long line like ¯ ) on top of the letters IV (as the macron multiplies the value by 1000), so 4000 would be represented by IV (4) with a macron on top, 5000 would be represented by V (5) with a macron on top, etc.
The problem I have is that I cannot make it happen in Python. I’ve looked for and seen many answers related, but when I try them, they don’t work in the simplest command.
For example, in my Python 3.7.4 Shell, I write the following command:
1) >>>
with the following output:
L¯
which is not what I want. I want the macron on top of the letter, not beside it.
I’ve tried switching the order of the unicode numbers of the letter and the combining character, and even using the join function as in:
2) >>>
L
and I guess almost any combination you may think of, but no result.
I find it quite curious, because if I want to put an acute accent or a small macron on top of the letter ‘e’, I have no trouble:
3) >>>
fué
4) >>>
fuē
But if I try it with the letters ‘M’ or even ‘m’, I cannot:
5) >>>
M̄
6) >>>
m̄
Even the following command:
7) >>>
fue̅
Please, is there somebody out there who can help me to write I, V, X, L, C, D and M with a long macron on top of them ('\u00AF' or '\u0305')?
Thanks in advance,
newbieAuggie2019
IMPORTANT EDIT!!!:
While previewing the post, to put a bit of colour to it, I found out that HERE, IN THIS FORUM, OPTIONS 5), 6) and 7) WORK, BUT NOT IN MY PYTHON 3.7.4 Shell. WHY IS THAT???
Let me try here this, then:
I̅V̅X̅L̅C̅D̅M̅
Okey, then. Maybe I should make the question in this way: What do I have to do to make it work in my Python 3.7.4 Shell???
Hi, I’m starting to learn Python, so I would appreciate your explanations like you would explain things to a kid. I’m using Python 3.7.4.
I want to represent the number 4000 in Roman numbers by putting a macron (a long line like ¯ ) on top of the letters IV (as the macron multiplies the value by 1000), so 4000 would be represented by IV (4) with a macron on top, 5000 would be represented by V (5) with a macron on top, etc.
The problem I have is that I cannot make it happen in Python. I’ve looked for and seen many answers related, but when I try them, they don’t work in the simplest command.
For example, in my Python 3.7.4 Shell, I write the following command:
1) >>>
print(u'\u004C'+ u'\u00AF')
with the following output:
L¯
which is not what I want. I want the macron on top of the letter, not beside it.
I’ve tried switching the order of the unicode numbers of the letter and the combining character, and even using the join function as in:
2) >>>
print('\u0305'.join('L'))with the following output:
L
and I guess almost any combination you may think of, but no result.
I find it quite curious, because if I want to put an acute accent or a small macron on top of the letter ‘e’, I have no trouble:
3) >>>
print('fue'+u'\u0301')with the following output:
fué
4) >>>
print('fue'+u'\u0304')with the following output:
fuē
But if I try it with the letters ‘M’ or even ‘m’, I cannot:
5) >>>
print('M'+u'\u0304')with the following output:
M̄
6) >>>
print('m'+u'\u0304')with the following output:
m̄
Even the following command:
7) >>>
print('fue'+u'\u0305')produces the output:
fue̅
Please, is there somebody out there who can help me to write I, V, X, L, C, D and M with a long macron on top of them ('\u00AF' or '\u0305')?
Thanks in advance,
newbieAuggie2019
IMPORTANT EDIT!!!:
While previewing the post, to put a bit of colour to it, I found out that HERE, IN THIS FORUM, OPTIONS 5), 6) and 7) WORK, BUT NOT IN MY PYTHON 3.7.4 Shell. WHY IS THAT???

Let me try here this, then:
print(u'\u0049'+ u'\u0305' + u'\u0056'+ u'\u0305' + u'\u0058'+ u'\u0305' + u'\u004C'+ u'\u0305' + u'\u0043'+ u'\u0305' + u'\u0044'+ u'\u0305' + u'\u004D'+ u'\u0305')Output:
I̅V̅X̅L̅C̅D̅M̅




Okey, then. Maybe I should make the question in this way: What do I have to do to make it work in my Python 3.7.4 Shell???

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
"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