1import requests
2# there is inbuilt json() constructor for requests.get() method
3json_data = requests.get("https://api.blinkist.com/v4/books/5420831a63656400089f0000").json()
4print(json_data)
5
6# To actually write the data to the file, we just call the dump() function from json library
7import json
8with open('personal.json', 'w') as json_file:
9 json.dump(json_data, json_file)
10
1from tkinter import *
2import os
3
4# window
5window = Tk()
6window.geometry("450x450")
7window.title("Gui App")
8window.configure(bg="powder blue")
9
10# Enter or user input in tkinter
11filename = Entry(window, width=75)
12filename.pack()
13
14# Run file Function
15
16def runFile():
17 try:
18 os.startfile(filename.get())
19
20 except:
21 error = Label(window, text=f"No file found as {filename.get}")
22 error.pack()
23
24 # Run file button
25open_file_button = Button(window, text="Run File", command=runFile)
26open_file_button.pack()
27
28window.mainloop()
29