Oct-27-2025, 06:50 PM
I been trying to build a program to use the OpenWeatherAPI with Tkinter. Things work well if I'm using live data. But I have one data set that provides national weather alert information saved in a json file.
When I read the json file in for some reason it is converted to a sting instead of leaving it as a dictionary. I have tried rewriting the code but the results are the same. You can see the error in the attached PDF file.
The data in the file is in dictionary format but when I try to import it something adds a "'", single quote to the beginning and end of the file. Thus changing from a dictionary to a string and my code to access the dictionary fields fails.
Any suggestions are greatly appreciated.
Ron R
Python 3.12.3 (main, Aug 14 2025, 17:47:21) [GCC 13.3.0] on linux via Visual Studio Code
When I read the json file in for some reason it is converted to a sting instead of leaving it as a dictionary. I have tried rewriting the code but the results are the same. You can see the error in the attached PDF file.
The data in the file is in dictionary format but when I try to import it something adds a "'", single quote to the beginning and end of the file. Thus changing from a dictionary to a string and my code to access the dictionary fields fails.
Any suggestions are greatly appreciated.
Ron R
Python 3.12.3 (main, Aug 14 2025, 17:47:21) [GCC 13.3.0] on linux via Visual Studio Code
Attached Files
