Is there a way to split these two into separate steps:
a) creating a .json file
b) manipulating it (a, r, w ...)

Example:

"import json
number_list = [1, 2, 3, 4, 5, 6, 7, 8, 9]
file_name = "my_numbers.json"
with open(file_name, "w") as a:
    json.dump(number_list, a)

What if I just wanted to create a .json file and do nothing with it?

import json
file_name = "my_numbers.json"

The above does not do the job. What am I getting wrong here? Thanks.
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to