Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning ASP.NET 2.0 And Databases

Authors: John Kauffman, Bradley Millington

1st Edition

0471781347, 978-0471781349

More Books

Students also viewed these Databases questions

Question

How do modern Dashboards differ from earlier implementations?

Answered: 1 week ago