title: Tkinter - How to center a Widget (Python)
body: <p>I started with the GUI in Python and have a problem. 
  I've added widgets to my frame, but they're always on the left side.
  I have tried some examples from the internet, but I did not manage it .
  I tried <code>.place</code>, but it does not work for me. Can one show me how to place the widgets in the middle?</p>
  
  <p>Code:</p>
  
  <pre><code>import tkinter as tk
  
  def site_open(frame):
      frame.tkraise()
  
  window = tk.Tk()
  
  window.title('Test')
  window.geometry('500x300')
  
  StartPage = tk.Frame(window)
  FirstPage = tk.Frame(window)
  
  for frame in (StartPage, FirstPage):
      frame.grid(row=0, column=0, sticky='news')
  
  lab = tk.Label(StartPage, text='Welcome to the Assistant').pack()
  lab1 = tk.Label(StartPage, text='\n We show you helpful information about you').pack()
  lab2 = tk.Label(StartPage, text='\n \n Name:').pack()
  ent = tk.Entry(StartPage).pack()
  but = tk.Button(StartPage, text='Press', command=lambda:site_open(FirstPage)).pack()
  
  lab1 = tk.Label(FirstPage, text='1Page').pack()
  but1 = tk.Button(FirstPage, text='Press', command=lambda:site_open(StartPage)).pack()
  
  site_open(StartPage)
  window.mainloop()
  </code></pre>