问题
I've been trying to create a basic gui using tkinter, I've done it before on a different computer but for some reason its invisible. Is there something wrong with my code or the computer (windows)?
import sys
from tkinter import *
mygui = Tk()
mygui.geometry('300x300+0+982')
mygui.title("my gui")
mygui.mainloop()
回答1:
Is your screen height is bigger than 982 pixel?
Following line place the window at (0, 982) with width 300, height 300. If your screen height smaller than 982 pixel, you can't see it.
mygui.geometry('300x300+0+982')
Replace it with following:
mygui.geometry('300x300+0+0')
and you will see it.
来源:https://stackoverflow.com/questions/20585560/my-tkinter-gui-is-invisible-for-unknown-reasons