title: how to set the position of a tkinter window without setting the dimensions
body: <p>I know a way to put a tkinter window lets say in the middle</p>
  
  <pre><code>from tkinter import *
  root=Tk()
  w=350
  h=285
  ws=root.winfo_screenwidth()
  hs=root.winfo_screenheight()
  x=(ws/2)-(w/2)
  y=(hs/2)-(h/2)
  root.geometry('%dx%d+%d+%d'%(w,h,x,y))   
  </code></pre>
  
  <p>In the above code the tkinter window will pop up in the middle with a height of 285 and a width of 350. but if i added too many widget the height 285 may not be enough. fort example lets say we added this code</p>
  
  <pre><code>for x in range(50):
      Label(root,text=x).pack()
  </code></pre>
  
  <p>only the first 13 numbers will be in the window since i set the height to a fixed number 285.</p>
  
  <p>so my question is would there be a way to put a tkinter window in the middle of the screen without setting the height and width, i mean if the height and the width are not set to a fixed number the window will continue to expand automatically.for example in the code below it expands automatically except the window is not in the middle.</p>
  
  <pre><code>from tkinter import *
  win=Tk()
  for x in range(50):
      Label(win,text=x).pack()
  </code></pre>