Python Forum
Python 3.5.2 & json on win 10
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python 3.5.2 & json on win 10
#6
No, I'm using Linux, and I tried Python 2 and Python 3.4. Python and JSON should both be platform independent though, so I don't think that's the problem. My best guess at this point is that you actually have an empty file, and you have an editor window open with unsaved changes.

If that's not the case, try running the code
import json

with open('schedule.json') as data_file:
   print("<>".format(data_file.read())) # print out the contents of the file, within <>
   data_file.seek(0) # restore file state so that the below line might work
   data = json.load(data_file)

print(data)
You can also try creating a Git repo or something that we can clone and know is reproducing the problem for you, since describing it over the forum might not be enough in this case.
Reply


Messages In This Thread
Python 3.5.2 & json on win 10 - by PickyBiker - Nov-28-2016, 12:00 AM
RE: Python 3.5.2 & json on win 10 - by micseydel - Nov-28-2016, 12:04 AM
RE: Python 3.5.2 & json on win 10 - by PickyBiker - Nov-28-2016, 12:32 AM
RE: Python 3.5.2 & json on win 10 - by micseydel - Nov-28-2016, 12:36 AM
RE: Python 3.5.2 & json on win 10 - by PickyBiker - Nov-28-2016, 12:43 AM
RE: Python 3.5.2 & json on win 10 - by micseydel - Nov-28-2016, 12:48 AM
RE: Python 3.5.2 & json on win 10 - by PickyBiker - Nov-28-2016, 04:16 AM
RE: Python 3.5.2 & json on win 10 - by micseydel - Nov-28-2016, 04:21 AM
RE: Python 3.5.2 & json on win 10 - by snippsat - Nov-28-2016, 06:32 AM
RE: Python 3.5.2 & json on win 10 - by PickyBiker - Nov-28-2016, 04:24 PM
RE: Python 3.5.2 & json on win 10 - by micseydel - Nov-28-2016, 04:30 PM
RE: Python 3.5.2 & json on win 10 - by PickyBiker - Nov-28-2016, 04:32 PM
RE: Python 3.5.2 & json on win 10 - by micseydel - Nov-28-2016, 04:58 PM
RE: Python 3.5.2 & json on win 10 - by Ofnuts - Nov-28-2016, 06:00 PM
RE: Python 3.5.2 & json on win 10 - by PickyBiker - Nov-28-2016, 06:01 PM
RE: Python 3.5.2 & json on win 10 - by micseydel - Nov-28-2016, 07:37 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python Split json into separate json based on node value CzarR 1 5,926 Jul-08-2022, 07:55 PM
Last Post: Larz60+
  difficulties to chage json data structure using json module in python Sibdar 1 2,147 Apr-03-2020, 06:47 PM
Last Post: micseydel

Forum Jump:

User Panel Messages

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