tring to export to csv file input from user in Tkinter
<p>I have code to take user import from Tkinter and put in a csv file.  In the Tkinter window I can use pack to setup my input boxes but don't like the it and want to use grid instead. The following code works for pack but I can't figure out how to do it grid. Sorry I am one month into learing the language.  Here is the code</p>

<pre><code>from Tkinter import * 
import csv

class App(Frame):
    def __init__(self, master=None):
        Frame.__init__(self, master)
        self.pack()
        self.output()
    def output(self):
        Label(text='First Name:').pack    (side=LEFT,padx=5,pady=5)
        self.e = Entry(root, width=10)
        self.e.pack(side=LEFT,padx=5,pady=5)
        Label(text='Last Name:').pack    (side=LEFT,padx=5,pady=5)
        self.e1 = Entry(root, width=10)
        self.e1.pack(side=LEFT,padx=5,pady=5)
        self.b = Button(root, text='Submit',command=self.writeToFile)
        self.b.pack(side=LEFT,padx=5,pady=5)
    def writeToFile(self):
        with open('WorkOrderLog.csv', 'a') as f:
            w=csv.writer(f, delimiter=',')
            w.writerow([self.e.get()])
            w.writerow([self.e1.get()])

if __name__ == "__main__":
    root=Tk()
    root.title('Auto Logger')
    root.geometry('500x200')
    app=App(master=root)
    app.mainloop()
    root.mainloop()
</code></pre>

<p>Use grid try think is like use a table, you asign the tkinterObjects in a "table" and then asign row/column, something like this.</p>

<pre><code>class App(Frame):
    def __init__(self, master=None):
        Frame.__init__(self, master)
        self.pack()
        self.output()
    def output(self):
        firstName=Label(self,text='First Name:')
        firstName.grid(row=1,column=0, padx=5, pady=3)
        self.e = Entry(self, width=10)
        self.e.grid(row=1,column=1, padx=5, pady=3)
        lastName=Label(self,text='Last Name:')
        lastName.grid(row=1,column=2, padx=5, pady=3)
        self.e1 = Entry(self, width=10)
        self.e1.grid(row=1,column=3, padx=5, pady=3)
        self.b = Button(self, text='Submit',command=self.writeToFile)
        self.b.grid(row=1,column=4, padx=5, pady=3)
    def writeToFile(self):
        with open('WorkOrderLog.csv', 'a') as f:
            w=csv.writer(f, delimiter=',')
            w.writerow([self.e.get()])
            w.writerow([self.e1.get()])


if __name__ == "__main__":
     root=Tk()
     root.title('Auto Logger')
     root.geometry('500x200')
     app=App(master=root)
     app.mainloop()
     root.mainloop()
</code></pre>

<p>all are in the "table" root</p>

python tkinter