第一个Python窗口

import tkinter
def my_window(w, h):
 ws = root1.winfo_screenwidth();
 hs = root1.winfo_screenheight();
 x = (ws/2) - (w/2);
 y = (hs/2) - (h/2);
 root1.geometry('%dx%d+%d+%d'%(w, h, x, y));
root1 = tkinter.Tk(className='python windows app')
my_window(640, 480);
root1.mainloop();

无废话,撸起袖子就是,干!

posted @ 2018-06-13 08:38  天使冰王  阅读(704)  评论(0编辑  收藏  举报