August 27th, 2013, 05:36 AM
Saving content of entry through save option in menu
Actually I want to save the content of entry using Save Option in menu.
I can directly use the e.get() but problem is I am creating entry and label depending upon total count in a file(list.txt).
And that is created easily but what I need is to save the content of each entry box through menubar. I dont know how exactly that could be done.Here is my piece of code. PLease let me know what should I add in it.
for line in fileinput.input(['list.txt']): label=Label(frame,text=line)
entry=Entry(frame,width=10) label.grid(row=count,sticky=W+E+N+S) entry.grid(row=count,column=1,sticky=W+E+N+S ) count=count+1
August 27th, 2013, 12:38 PM
You have to save the Entry boxes id's so you know which widget you want to get from. So append each one to a list.
import Tkinter as tk ## Python 2.x
import tkinter as tk ## Python 3.x
top_frame = tk.Tk()
for entry in list_of_boxes:
list_of_boxes = 
for count in range(5):
label=tk.Label(top_frame, text=str(count), width=10)
but=tk.Button(top_frame, text="Get Contents", command=button_pressed)
August 28th, 2013, 02:26 AM
Thanks man.....This will help me