title: Which is better for tkinter grid, placing individual items or looping through list to place them?
body: <p>I have a few very large forms that I have been working on in tkinter and Im not sure which way I should implement all the buttons and text boxes. Or if I should just not do it in python/find a new way entirely... The end game is that it is connected to a sqlite3 database and it stores the entries there for me to export later.</p>
  
  <p>First way, I have made each individual input box and placed it where I wanted it, which ended up being 426 lines of code and looked like this over and over again... Much more straight forward on what it's doing than the second option..</p>
  
  <pre><code>tk.Label(window,text="Lead Operator: ").grid(row=1,column=0)
  Operator2 = tk.StringVar()
  operator2_entry = tk.Entry(window,textvariable=Operator2)
  operator2_entry.grid(row=1,column=1)
  </code></pre>
  
  <p>Second option I tried is a list with all 50 some inputs and looping through different sections of the list to place them where I wanted them to go and looks like this.. I feel like option two is convoluted but it does several inputs at once.. </p>
  
  <pre><code>for item in list(labels)[10:18:4]:
      tk.Label(master,text=item).grid(row=list(labels.keys()).index(item)+2,column=0)
  for item in list(variable)[10:18:4]:
      item = tk.StringVar()
  for item in list(entries)[10:18:4]:
      tk.Entry(master,textvariable=list(variable.keys()).index(item[:-6])).grid(row=list(entries.keys()).index(item)+2,column=1)
  </code></pre>
  
  <p>I couldn't tell you which is more efficient but the end program is already over 30MB and takes at least 2-3 seconds to start up without one of the biggest forms I need so I'm not sure if doing option two would help cut down on that or not.
  Should I abandon python and go for something in a different language? I am not that great at programming yet so I don't even know what forms like this would usually be coded in.</p>