#Text Frame
TextFrame = Frame(win, bg="#003030")
TextFrame.pack(fill=BOTH, expand=True)
#Create a Text Box
TextBox = Text(TextFrame)
TextBox.pack(side="bottom", fill=BOTH, expand=True)
#Color Picker
choose = ["#ff0000", "#0000ff"]
color = choice(choose)
#Button Function
def render():
global color
from tkinter import Text
input = (TextBox.get("1.0",'end-1c')) #Takes input from the Text Box
win2 = Toplevel()
win2.attributes("-fullscreen", True)
TextFull = Text(win2, font="Ubuntu 14",**fg=choice(choose)**, bg="black")
TextFull.insert(0.0,input) #Displays Input from first window to second window
TextFull.pack(fill=BOTH, expand=True)
如何从文本框中的选择列表中获取随机 fg 颜色。目前我一次只能得到一种 fg 颜色。
呼如林
当年话下
相关分类