I am using blender on windows, following the tutorial: Visualize JSON Data in blender but I am stuck trying to open the JSON file.
My code (windows):
import json
with open('C:\Users\Franktabs\Documents\export.json') as f:
j = json.load(f)
print(j)
His code(linux):
import json
with open('/home/chris/Downalds/tutorial.son') as f:
j = json.load(f)
print(j)
Error Message:
Python: File "C:\Users\Franktabs\Documents\Json2.blend\My Script", line 3
with open('C:\Users\Franktabs\Documents\export.json') as f:
^ SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
location: <unknown location>:-1
Solutions Tried:
- Using import bpy
- Using double \
- Using 'r'
- Using utf-8
- Checking the file type is actually .json
- Checking the route and name of the file in properties
Solutions sources from a person with the same problem: post1,post2