Hide text in entry box when i click on it.(GUI using Tkinter in python)

2017-01-24 Thread hmmeeranrizvi18
Hello Guys,
Here i am creating a entry box with some text,i need to hide the text when i 
click on it.
Here is my code

from Tkinter import *
obj = Tk()
b = Entry(obj,width=100)
b.insert(0,"Enter the value to search")
b.pack()
mainloop()

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Hide text in entry box when i click on it.(GUI using Tkinter in python)

2017-01-25 Thread hmmeeranrizvi18
On Wednesday, January 25, 2017 at 1:15:11 PM UTC+5:30, hmmeera...@gmail.com 
wrote:
> Hello Guys,
> Here i am creating a entry box with some text,i need to hide the text when i 
> click on it.
> Here is my code
> 
> from Tkinter import *
> obj = Tk()
> b = Entry(obj,width=100)
> b.insert(0,"Enter the value to search")
> b.pack()
> mainloop()

Thanks Peter
-- 
https://mail.python.org/mailman/listinfo/python-list


Display a label while pressing the button in my GUI

2017-01-29 Thread hmmeeranrizvi18
Hello Guys,
Here i am creating a GUI which will act as a search engine that will find the 
results from the browser and save the results as a xls file.
When i typed something in my search box and click the (GO)button.It should 
display search in progress.when the file is saved it should display done.
How to do that?
My button gets hung for a seconds.We should give any timeout for that?

Here is my script

from Tkinter import *
import mechanize
def clear_search(event):
search.delete(0,END)
obj = Tk()
Label = Label(obj,text="Top Findings:",font="-weight bold")
search = Entry(obj,width=100)
search.insert(0, "Enter the value to search")
search.bind("", clear_search)
def fun():
new = search.get()
url = "http://duckduckgo.com/html";
br = mechanize.Browser()
br.set_handle_robots(False)
br.open(url)
br.select_form(name="x")
br["q"] = str(new)
res = br.submit()
content = res.read()
with open("result1.xls", "w") as f:
f.write(content)
fun()
Go = Button(obj,text="GO",width=5,command=fun)
Label.pack()
search.pack()
Go.pack()
mainloop()

-- 
https://mail.python.org/mailman/listinfo/python-list