0

I'm not quite sure on how you write a JSON so can you please help me, i'm trying to make this with JSON in python. Here's the pseudo-code

binary_students = json(students)

write_to_the_file_system(binary_students)

I'm not quite understanding it, can someone help me please.

Gurwinder Singh
  • 38,557
  • 6
  • 51
  • 76

1 Answers1

1

You can use a dictionary for storing Json data like this:

>>> dict = {'Student1':'x1','Student2':'x2'}

and then use the jsonlibrary

>>> import json
>>> with open('data.txt', 'w') as outfile:
    json.dump(dict,outfile)
user2314737
  • 27,088
  • 20
  • 102
  • 114