Приветствую друзья! Скажите пожалуйста как в функцию
start передать переменные из Tk что бы
f =
button (т.е. выбранный файлик) и
url =
entry_area. Заранее благодарю :)
from Tkinter import*
from tkFileDialog import askopenfilename
def start():
url = 'http://www.google.com/'
f = open('test.txt', 'w+')
site = urllib.urlopen(url).read()
f.write(site)
def open_file():
askopenfilename(filetypes=[("Text", ".txt")])
root = Tk()
root ['bd'] = 5
root.title(u'Парсер')
main_frame = Frame(root)
url_label = Label(root, text = u'Введите урл странички').pack()
entry_area = Entry(root, width = 23).pack()
button = Button(root, width = 20, text = u'Файл для записи', command = open_file).pack()
button_start = Button(root, width = 20, text = u'Старт', command = start).pack()
root.mainloop()