Question
I have a Python Project . which is not working. Please assit me on these codes mport tkinter as tk from tkinter import ttk import
I have a Python Project . which is not working. Please assit me on these codes
mport tkinter as tk from tkinter import ttk import json import requests as re url = "https://twitter.com/search.json?q= 'chine" #twitter_api = twitter.read_token_file("https://twitter.com/") class NametFrame(ttk.Frame): def __init__(self, parent): ttk.Frame.__init__(self, parent, padding = '10 10 10 10') self.pack(fill = tk.BOTH, expand = True) #Define string variable for the entry field self.fieldname = tk.StringVar() #Create a label , an ntry field , and a button ttk.Label(self, text = "Your name : ").grid(column = 0, row = 0, sticky = tk.E) ttk.Entry(self, width = 25, textvariable = self.fieldname).grid(column = 1, row = 0) ttk.Button(self, text = "Search", command = self.search).grid(column = 2, row = 0) #Add padding to all child components for child in self.winfo_children(): child.grid_configure(padx = 5, pady = 3) #Define the callback method for clear button def search(self): name = self.fieldname.get() result = re.get(url) better_result = result.json() print(len(better_result)) return better_result if __name__ == '__main__': root = tk.Tk() #Create the roor window root.title("Searching your name on Twitter ") #Create frame NametFrame(root) root.mainloop()
Im getting these errors
in
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started