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();

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

相关文章:

  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
  • 2021-06-09
  • 2021-09-27
  • 2022-12-23
  • 2021-11-23
  • 2021-12-16
猜你喜欢
  • 2022-12-23
  • 2021-08-12
  • 2021-10-22
  • 2022-12-23
  • 2021-04-20
  • 2022-12-23
相关资源
相似解决方案