好吧,我看过很多关于大多数相关问题的帖子,但没有一个完全适合我的。
这些是软件的规格: Python 3.3(多个副本,一个在 Windows XP 32 位上,另一个在 Windows 7 64 位上)两个副本上的相同问题 两台机器上都存在用于 Python 的 win32 API
这是代码:
#Training Program for Chemence Owned Laser Cutter
#Written by Jared Lunt in the Python Programming Language.
try:
import tkinter
except ImportError:
raise ImportError ("The tkinter Module is required to run this program.")
main = tkinter.Tk()
#The first objective of the app design is to state the Title
main.title("Laser Cutter Operations Training")
#The second objective of the app design is to define the size of the Main Window.
import sys, cmd
sys.path.append('C:/Python33//Lib/site-packages/win32')
from win32api import GetSystemMetrics
systemWidth = GetSystemMetrics (0)
systemHeight = GetSystemMetrics (1)
width = systemWidth / 2
height = systemHeight / 2
left = width / 2
top = height / 2
window = cmd.window()
cmd.ShowWindow(window)
cmd.window(window, edit=True, topLeftCorner=( top, left ), widthHeight=( width, height ) )
main.mainloop()'