empty text variable label- Python 3.6 - High Sierra OSX

0

I have problems using label.config(textvariable=texto) .
As a result, it seems that text StringVar() has no content because 'TextoVariable' does not appear in the window.
It seems to be an error of Tkinter in High Sierra and not in Windows .
Is there another syntax to show variables as StringVar ?

import tkinter as tk

root = tk.Tk() 
texto = tk.StringVar(value='Texto inicial')
texto.set(value='TextoVariable')

label = tk.Label(root)
label.pack(anchor='center')

tk.Label(root, text='Hola Saturno').pack(anchor='se')

label.config(bg='green', fg='blue', font=('Verdana',24))
label.config(textvariable=texto)

root.mainloop() 
    
asked by Javier 19.06.2018 в 13:40
source

0 answers