阅读背景:

python设置图片背景和设置字体颜色大小

来源:互联网 
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 11 22:37:30 2019
@author: Dell
"""
import tkinter

win = tkinter.Tk()

#显示图片
photo = tkinter.PhotoImage(file=r"C:\Users\Dell\Pictures\董香2.png")
label = tkinter.Label(win, text="少儿不宜", image=photo)
label.pack()

#设置字体颜色大小等
lbl = tkinter.Label(win, text="Hello 中国", font=("华文彩云", 100), fg="red", bg="black")
lbl.pack()

win.mainloop()
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 1



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: