Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to read json file
#21
A part of problem is that you struggle with basic understating of this Undecided
I gone explain in detail under here,if this don't work ask someone to help you local.
jk91 Wrote:i tried to download from your link but after downloading it,i can not open it and my computer
There is no need to open data.json(then you can mess it up if save it),you shall just open colab then File --> New Notebook .
You copy is this code:
# test_read.py
import json
from pprint import pprint
 
with open("data.json", "r") as read_file:
    data = json.load(read_file)
 
pprint(data)
Then on Files left side menu,here you choice upload as in image.
Now find data.json on your hard-drive and upload.
Now push Run Cell button and it should work.
jk91 Wrote:my computer say's look for appropriate program from internet to open such files also i tried to save my data.json
That because you have not JSON set to open in a program file associations.
This is is how it should be you can choice what you want eg basic notepad or better a basic editor like Notepad ++.

jk91 Wrote:last post as .ipynd in file extension but some how that notepad file gets saved in .txt format only not sure what is wrong here.
You most be careful to save in notepad all will be .txt default,have to choice all files the type file name wanted and save.
Why to do talk about .ipynd,do as posted here,
after you get all to work you can download the Notebook the it will in .ipynd format.
Here have i downloaded it and share it with nbviewer My Notebook.
Reply


Messages In This Thread
how to read json file - by jk91 - Feb-18-2020, 11:48 AM
RE: how to read json file - by Larz60+ - Feb-18-2020, 06:02 PM
RE: how to read json file - by ndc85430 - Feb-18-2020, 06:10 PM
RE: how to read json file - by jk91 - Feb-19-2020, 05:44 AM
RE: how to read json file - by ndc85430 - Feb-19-2020, 06:41 AM
RE: how to read json file - by jk91 - Feb-19-2020, 07:28 AM
RE: how to read json file - by jk91 - Feb-20-2020, 06:17 AM
RE: how to read json file - by jk91 - Feb-20-2020, 09:18 AM
RE: how to read json file - by buran - Feb-20-2020, 09:40 AM
RE: how to read json file - by snippsat - Feb-20-2020, 10:03 AM
RE: how to read json file - by jk91 - Feb-20-2020, 11:20 AM
RE: how to read json file - by snippsat - Feb-20-2020, 12:07 PM
RE: how to read json file - by jk91 - Feb-20-2020, 02:10 PM
RE: how to read json file - by snippsat - Feb-20-2020, 02:38 PM
RE: how to read json file - by jk91 - Feb-23-2020, 06:37 AM
RE: how to read json file - by snippsat - Feb-23-2020, 10:49 AM
RE: how to read json file - by jk91 - Feb-23-2020, 11:03 AM
RE: how to read json file - by snippsat - Feb-23-2020, 12:06 PM
RE: how to read json file - by jk91 - Feb-23-2020, 01:17 PM
RE: how to read json file - by jk91 - Feb-23-2020, 02:24 PM
RE: how to read json file - by snippsat - Feb-23-2020, 03:30 PM
RE: how to read json file - by jk91 - Feb-23-2020, 04:26 PM
RE: how to read json file - by snippsat - Feb-23-2020, 04:50 PM
RE: how to read json file - by jk91 - Feb-24-2020, 11:56 AM
RE: how to read json file - by jk91 - Feb-24-2020, 01:15 PM
RE: how to read json file - by buran - Feb-24-2020, 01:28 PM
RE: how to read json file - by jk91 - Feb-24-2020, 01:38 PM
RE: how to read json file - by snippsat - Feb-24-2020, 01:45 PM
RE: how to read json file - by jk91 - Feb-24-2020, 06:22 PM
RE: how to read json file - by snippsat - Feb-24-2020, 07:45 PM
RE: how to read json file - by jk91 - Feb-25-2020, 04:11 PM
RE: how to read json file - by t4keheart - Feb-25-2020, 02:08 PM
RE: how to read json file - by t4keheart - Feb-25-2020, 06:24 PM
RE: how to read json file - by jk91 - Feb-26-2020, 08:10 AM
RE: how to read json file - by snippsat - Feb-26-2020, 05:07 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  encrypt data in json file help jacksfrustration 1 239 Mar-28-2024, 05:16 PM
Last Post: deanhystad
  Recommended way to read/create PDF file? Winfried 3 2,907 Nov-26-2023, 07:51 AM
Last Post: Pedroski55
  parse json field from csv file lebossejames 4 772 Nov-14-2023, 11:34 PM
Last Post: snippsat
  python Read each xlsx file and write it into csv with pipe delimiter mg24 4 1,480 Nov-09-2023, 10:56 AM
Last Post: mg24
  read file txt on my pc to telegram bot api Tupa 0 1,139 Jul-06-2023, 01:52 AM
Last Post: Tupa
  parse/read from file seperated by dots giovanne 5 1,130 Jun-26-2023, 12:26 PM
Last Post: DeaD_EyE
  Formatting a date time string read from a csv file DosAtPython 5 1,306 Jun-19-2023, 02:12 PM
Last Post: DosAtPython
  How do I read and write a binary file in Python? blackears 6 6,730 Jun-06-2023, 06:37 PM
Last Post: rajeshgk
  Python Script to convert Json to CSV file chvsnarayana 8 2,554 Apr-26-2023, 10:31 PM
Last Post: DeaD_EyE
  Loop through json file and reset values [SOLVED] AlphaInc 2 2,153 Apr-06-2023, 11:15 AM
Last Post: AlphaInc

Forum Jump:

User Panel Messages

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