My code:
Code:
I am trying to make a google interpreter but this error shows up:
>>> Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\warth\AppData\Local\Programs\Python\Python39\lib\tkinter\__init__.py", line 1885, in __call__
return self.func(*args)
File "C:\Users\warth\AppData\Local\Programs\Python\Python39\Emphorium_main.py", line 13, in search_input
results()
File "C:\Users\warth\AppData\Local\Programs\Python\Python39\Emphorium_main.py", line 17, in results
results1.pack()
File "C:\Users\warth\AppData\Local\Programs\Python\Python39\lib\tkinter\__init__.py", line 2389, in pack_configure
self.tk.call(
_tkinter.TclError: cannot use geometry manager pack inside . which already has slaves managed by grid
Code:
from tkinter import *
from googlesearch import search
def search_input():
global e
global j
search1 = e.get()
try:
from googlesearch import search
except ImportError:
print("No module named google")
for j in search(search1, tld="co.in", num=10, stop=10, pause=2):
results()
def results():
results1 = Label(text = j)
results1.pack()
main_screen = Tk()
main_screen.geometry("700x250")
main_screen.title("Inphorium")
e = Entry(main_screen, width=40, borderwidth=5)
e.grid(row=3, column=4, columnspan=3, padx=10, pady=10)
submit = Button(main_screen, text = "Search", width = 5, command = search_input)
submit.grid(row=3, column = 8)
spacer = Label(main_screen, text = " ")
spacer.grid(row = 3, column = 0)
spacer = Label(main_screen, text = " ")
spacer.grid(row = 3, column = 1)
spacer = Label(main_screen, text = " ")
spacer.grid(row = 3, column = 2)
spacer = Label(main_screen, text = " ")
spacer.grid(row = 3, column = 3)
spacer = Label(main_screen, text = " ")
spacer.grid(row=0,column=0)
spacer = Label(main_screen, text = " ")
spacer.grid(row=1,column=0)
I am trying to make a google interpreter but this error shows up:
>>> Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\warth\AppData\Local\Programs\Python\Python39\lib\tkinter\__init__.py", line 1885, in __call__
return self.func(*args)
File "C:\Users\warth\AppData\Local\Programs\Python\Python39\Emphorium_main.py", line 13, in search_input
results()
File "C:\Users\warth\AppData\Local\Programs\Python\Python39\Emphorium_main.py", line 17, in results
results1.pack()
File "C:\Users\warth\AppData\Local\Programs\Python\Python39\lib\tkinter\__init__.py", line 2389, in pack_configure
self.tk.call(
_tkinter.TclError: cannot use geometry manager pack inside . which already has slaves managed by grid