我正在尝试从另一个方法值中减去一个方法值,但即使我使用变量也会给我一个错误。
from tkinter import *
statistics = Tk()
screenwidth = statistics.winfo_screenwidth
windowwidth = statistics.winfo_width
distance = screenwidth - windowwidth
statistics.geometry(+distance+'0')
答案 0 :(得分:2)
你试图减去两个函数。您想要减去调用函数的结果。试试这个:
from Tkinter import *
statistics = Tk()
screenwidth = statistics.winfo_screenwidth()
windowwidth = statistics.winfo_width()
distance = screenwidth - windowwidth
statistics.geometry('+%s+0' % distance)