Sep-15-2020, 03:43 AM
I'm trying to print out a list using tkinter and a custom font with the font family that is named Voynich. I have made several lists named Vglyphs that use the random module and I would like to display the output in the voynich text font. If you loaded this piece of code into your python idle as you can see it prints the text. I would really like to see the Vglyphs = list print the output of the Voynich font yet I'm new to python and I'm slugging through this as it is. Thanks for any help :)
from tkinter import * from tkinter.font import Font root = Tk() my_font = Font(family="Voynich", size=16) label = Label(root, text="I would like this t to print, that is set to Vglyphs", font=my_font).pack() root.geometry("300x300+120+120") root.mainloop() import random while True: e = int(input("Enter a number 1 through 12 to make a Voynich Vord: ")) Vglyphs1 = ['y','e','9'] Vglyphs2 = ['o','a','8','1','3'] Vglyphs3 = ['1','8','3','4'] Vglyphs4 = ['o','c','a','8'] if e == 3 : t = random.choices(Vglyphs3,weights=[6,8,2,2]) print(*t , end="" ) pass if e == 3: t = random.choices(Vglyphs4,weights=[13,10,8,8]) print(*t , end="" ) root.mainloop() pass if e == 3: t = random.choices(Vglyphs1,weights=[3,4,11]) print(*t , end="" ) print("\n") continue if e == 2: t = random.choices(Vglyphs2,weights=[13,8,8,6,2],) print(*t , end="" ) pass if e == 2: t = random.choices(Vglyphs1,weights=[7,6,4]) print(*t , end="") print("\n") continue elif e < 3: print(*t , end="") break