1

I am trying to create a GUI for a phyiscs project and I need subscripts of these things. H_0, Omega_b, Omega_dm, Omega_\Lambda Omega_r in the form of latex

My code is something like this

   import PySimpleGUI as sg

sg.change_look_and_feel('Topanga')      

layout = [
    [sg.Text('Enter the Parameters')],
    [sg.Text("H\N{SUBSCRIPT ZERO}", size=(15, 1)), sg.InputText()],
    [sg.Text("\N{GREEK CAPITAL LETTER OMEGA}\N{LATIN SUBSCRIPT SMALL LETTER B}", size=(15, 1)), sg.InputText()],
    [sg.Text("\N{GREEK CAPITAL LETTER OMEGA}\N{LATIN SUBSCRIPT SMALL LETTER R}", size=(15, 1)), sg.InputText()],
    [sg.Text("\N{GREEK CAPITAL LETTER OMEGA}\N{GREEK SUBSCRIPT SMALL LETTER LAMDA}", size=(15, 1)), sg.InputText()],
    [sg.Text("\N{GREEK CAPITAL LETTER OMEGA}\N{LATIN SUBSCRIPT SMALL LETTER DM}", size=(15, 1)), sg.InputText()],
    [sg.Text("z", size=(15, 1)), sg.InputText()],
    [sg.Submit(), sg.Cancel()]
]

window = sg.Window('Simple data entry window', layout)
event, values = window.read()
window.close()
print(event, values[0], values[1], values[2], values[3], values[4], values[5])  

The most interesting thing is that it can print letters such as M or R but it cannot print B ?? Or It can print phi but it cannot print lambda ?

You can try this to see that this combination works.

import PySimpleGUI as sg

sg.change_look_and_feel('Topanga')      

layout = [
    [sg.Text('Enter the Parameters')],
    [sg.Text("H\N{SUBSCRIPT ZERO}", size=(15, 1)), sg.InputText()],
    [sg.Text("\N{GREEK CAPITAL LETTER OMEGA}\N{LATIN SUBSCRIPT SMALL LETTER M}", size=(15, 1)), sg.InputText()],
    [sg.Text("\N{GREEK CAPITAL LETTER OMEGA}\N{LATIN SUBSCRIPT SMALL LETTER R}", size=(15, 1)), sg.InputText()],
    [sg.Text("\N{GREEK CAPITAL LETTER OMEGA}\N{GREEK SUBSCRIPT SMALL LETTER PHI}", size=(15, 1)), sg.InputText()],
    [sg.Text("z", size=(15, 1)), sg.InputText()],
    [sg.Submit(), sg.Cancel()]
]

window = sg.Window('Simple data entry window', layout)
event, values = window.read()
window.close()
print(event, values[0], values[1], values[2], values[3], values[4], values[5])  

Please help, Thanks

Green Cloak Guy
  • 23,793
  • 4
  • 33
  • 53
Layla
  • 117
  • 2
  • 7
  • Why not use the code-point notation instead of using the names? Have you tried to access the characters using that approach? Or paste in the character themselves into the string? – Mike from PSG Dec 05 '19 at 04:53
  • @MikeyB I tried both it does not work. Or I did it in a wrong way. Idk – Layla Dec 05 '19 at 05:26
  • They are not part of the Unicode definition from what I've been able to find. – Mike from PSG Dec 05 '19 at 22:46
  • @MikeyB Yes it seems that way. Then is a there way to insert an image instead of text ? – Layla Dec 06 '19 at 06:28
  • It's a limitation of unicode: https://stackoverflow.com/questions/17908593/how-to-find-the-unicode-of-the-subscript-alphabet – D1s1ntegrator Nov 16 '21 at 12:40

0 Answers0