Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Validate JSON file
Post: RE: Validate JSON file

Thanks, that works now. However, if the JSON file is saved as UTF-8 encoding, it will not read the file, the scripts throws up the following message invalid json: 'charmap' codec can't decode byte 0...
BellaMac General Coding Help 12 5,404 Feb-27-2020, 08:41 AM
    Thread: Validate JSON file
Post: RE: Validate JSON file

This is the code in the script as what I posted previous import json def parse(text): try: with open("C:\python-script\file\assetLink_tr-TR.json") as f: return json.load(f...
BellaMac General Coding Help 12 5,404 Feb-26-2020, 06:03 PM
    Thread: Validate JSON file
Post: RE: Validate JSON file

Hi, I do want to catch the exception (I apologise if I have confused you), I want the script to tell me what line has the issue as what occurs when validating online. But when I run the script using ...
BellaMac General Coding Help 12 5,404 Feb-26-2020, 05:46 PM
    Thread: Validate JSON file
Post: RE: Validate JSON file

Can anyone help me with the code. Much appreciated. Bella
BellaMac General Coding Help 12 5,404 Feb-26-2020, 02:13 PM
    Thread: Validate JSON file
Post: RE: Validate JSON file

Thanks, for the help with the Indenting. However, the validation does not work as expected. When i run the script, it does not throw up an exception regarding issues in the JSON file as i know the...
BellaMac General Coding Help 12 5,404 Feb-25-2020, 01:44 PM
    Thread: Validate JSON file
Post: RE: Validate JSON file

Thanks for the reply, but now getting the error for the "return json.load(f)" line of code. This is what i changed the code to import json def parse(text): try: with open("C:\python-sc...
BellaMac General Coding Help 12 5,404 Feb-25-2020, 11:11 AM
    Thread: Validate JSON file
Post: Validate JSON file

Hi, I am new to the python language (well new to any programming language). From what I have been reding on-line, python has components to validate JSON files, which is what I need to do. In stalled ...
BellaMac General Coding Help 12 5,404 Feb-25-2020, 10:42 AM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020