Python t了解如何从背景中去除白点

Python t了解如何从背景中去除白点,python,python-3.x,tkinter,Python,Python 3.x,Tkinter,当我将背景色设置为与白色不同的颜色时,始终在屏幕中央显示一个白色像素。有人知道我该如何移除它吗? 求你了,我需要帮助! 这是我的代码: #! usr/bin/python # Filename: x_Factorial!_GUI.py import sys, warnings if sys.version_info[0] < 3: warnings.warn("System FAILURE, Python 3.x is required in order to execute

当我将背景色设置为与白色不同的颜色时,始终在屏幕中央显示一个白色像素。有人知道我该如何移除它吗? 求你了,我需要帮助! 这是我的代码:

#! usr/bin/python
# Filename: x_Factorial!_GUI.py

import sys, warnings

if sys.version_info[0] < 3:
    warnings.warn("System FAILURE, Python 3.x is required in order to execute this program", RuntimeWarning)
else:
    version_info_num = str(sys.version_info[0]) + "." + str(sys.version_info[1]) + "." + str(sys.version_info[2])
    print("System SUCCESS, You are currently executing this program on Python's version: ", version_info_num)

import tkinter as tk
from tkinter import Entry, Text, StringVar

class Application(tk.Frame):
    def __init__(self, master = None):
        tk.Frame.__init__(self, master)

        self.master.minsize(width = 800, height = 600)
        self.master.update()

        win_width = self.master.winfo_width()
        win_height = self.master.winfo_height()
        scr_xloc = int(self.master.winfo_screenwidth() / 2 - win_width / 2)
        scr_yloc = int(self.master.winfo_screenheight() / 2 - win_height / 2 - 30)

        self.master.geometry("{}x{}+{}+{}".format(win_width, win_height,
                                             scr_xloc, scr_yloc))

        self.master.title("x_Factorial!")
        self.master.configure(bg = "#F06428")

        self.pack(expand = 1)

        self.master.bind("<F11>", self.Toggle_Fullscreen)
        self.State = False

        self.master.bind("<Escape>", self.Quit)

    def Toggle_Fullscreen(self, event):
        self.State = not self.State
        self.master.attributes("-fullscreen", self.State)

    def Quit(self, event):
        root.destroy()

root = tk.Tk()
App = Application(master = root)

App.mainloop()
#!usr/bin/python
#文件名:x_阶乘_GUI.py
导入系统,警告
如果系统版本信息[0]<3:
warning.warn(“系统故障,需要Python 3.x才能执行此程序”,RuntimeWarning)
其他:
version\u info\u num=str(系统版本信息[0])+“+”+str(系统版本信息[1])+“+str(系统版本信息[2]))
print(“系统成功,您当前正在Python版本:”,version\u info\u num上执行此程序)
将tkinter作为tk导入
从tkinter导入条目,文本,StringVar
类应用程序(tk.Frame):
def uuu init uuu(self,master=None):
tk.Frame.\uuuuu init\uuuuuuu(自,主)
self.master.minsize(宽=800,高=600)
self.master.update()
win\u width=self.master.winfo\u width()
win_height=self.master.winfo_height()
scr\u xloc=int(self.master.winfo\u screenwidth()/2-win\u width/2)
scr\u yloc=int(self.master.winfo\u屏幕高度()/2-win\u高度/2-30)
self.master.geometry(“{}x{}+{}+{}+{}.”格式(win_宽度,win_高度,
scr_xloc,scr_yloc))
self.master.title(“x_阶乘!”)
self.master.configure(bg=“#F06428”)
self.pack(扩展=1)
self.master.bind(“,self.Toggle_全屏)
self.State=False
self.master.bind(“,self.Quit)
def切换_全屏(自身、事件):
self.State=非self.State
self.master.attributes(“-全屏”,self.State)
def退出(自我,事件):
root.destroy()
root=tk.tk()
应用程序=应用程序(主程序=根)
App.mainloop()

中间的像素是
应用程序
类的实例,它是一个帧。因为您没有在该框架中放置任何小部件,所以它的大小为1x1

为了使这一点更加明显,请在
\uuuuu init\uuuuuu
中的某个位置添加以下代码行,以使“像素”变大并呈蓝色:

self.configure(background="blue", width=10, height=10)