in Education by
I wrote the following code to quickly grab and display information from Wikipedia. It works great unless the Wiki summary contains more information than the box can display. I thought adding sticky = N+S+E+W would fix this but it doesn't appear to be doing anything. How can I update this code to make it scroll if there is too much information to display in the text box all at once? enter code here import sys from tkinter import * import wikipedia def search_wiki(): txt = text.get() # Get what the user entered into the box txt = wikipedia.page(txt) # Search Wikipedia for results txt = txt.summary # Store the returned information lblText = Label(main, text=txt,justify=LEFT,wraplength=600, fg='black', bg='white', font='times 12 bold').grid(row = 50, column = 1, sticky=N+S+E+W) main = Tk() main.title("Search Wikipedia") main.geometry('750x750') main.configure(background='ivory3') text = StringVar() lblSearch = Label(main, text = 'Search String:').grid(row = 0, column = 0, padx = 0, pady = 10) entSearch = Entry(main, textvariable = text, width = 50).grid(row = 0, column = 1) btn = Button(main, text = 'Search', bg='ivory2', width = 10, command = search_wiki).grid(row = 0, column = 10) main.mainloop() JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Substitute you label with a more appropriate widget such as lblText = ScrolledText(main, bg='white', relief=GROOVE, height=600, #width=400, font='TkFixedFont',).grid(row = 50, column = 1, sticky=N+S+E+W)

Related questions

0 votes
    I'm trying to take the text from a ttk label and assign it to a variable, but I don't actually ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 16, 2022 in Education by JackTerrance
0 votes
    I'm trying to take the text from a ttk label and assign it to a variable, but I don't actually ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 13, 2022 in Education by JackTerrance
0 votes
    So, I am creating an application which displays song lyrics for entered songs, however, longer songs do not ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 21, 2022 in Education by JackTerrance
0 votes
    I need to find a way to clear the Listbox for the refresh function which I am making. The function should ... clearing the Listbox) Select the correct answer from above options...
asked Jan 18, 2022 in Education by JackTerrance
0 votes
    I'm trying to make the text move continuously by pressing a button but right now it only moves an ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 1, 2022 in Education by JackTerrance
0 votes
    I want to draw arrows (that change size dynamically) within a Label or any other widget. I have ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 25, 2022 in Education by JackTerrance
0 votes
    I would like to send one request when I scroll the tableview up and another request when I scroll down ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    I would like to send one request when I scroll the tableview up and another request when I scroll down ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 16, 2022 in Education by JackTerrance
0 votes
    I would like to send one request when I scroll the tableview up and another request when I scroll down ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 16, 2022 in Education by JackTerrance
0 votes
    I would like to send one request when I scroll the tableview up and another request when I scroll down ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 16, 2022 in Education by JackTerrance
0 votes
    I am creating RPA. Text box have some default value. I want to enter my value after clearing that default value ... in for loop. Select the correct answer from above options...
asked Feb 1, 2022 in Education by JackTerrance
0 votes
    I am new to VBA and I'm trying to create a form in Access where a text box is enabled or ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 5, 2022 in Education by JackTerrance
0 votes
    The Problem is simple, The below shown is an input text box. i've set the value of the input box ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 27, 2022 in Education by JackTerrance
0 votes
    The Problem is simple, The below shown is an input text box. i've set the value of the input box ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
0 votes
    I need some help! I've throroughly searched the web for a solution to my issue, but haven't got ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 19, 2022 in Education by JackTerrance
...