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 betterResult = result.json() File "C:\Users\mash4\AppData\Local\Programs\Python\Python36-32\lib\site-packages equests\models.py", line 892, in json return complexjson.loads(self.text, **kwargs) File "C:\Users\mash4\AppData\Local\Programs\Python\Python36-32\lib\json\__init__.py", line 354, in loads return _default_decoder.decode(s) File "C:\Users\mash4\AppData\Local\Programs\Python\Python36-32\lib\json\decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Users\mash4\AppData\Local\Programs\Python\Python36-32\lib\json\decoder.py", line 357, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!