I have a sample json file example below
{
"email": "string",
"cont_pic": "string",
"title": "string",
"user_cd": "string",
"type4": "string"
}
and want to convert into a formatted string like example below , it will convert into public static XX= 'yy';
Where XX is the Upper case of yy
public static EMAIL= 'email';
public static CONTACT_PIC = 'cont_pic';
public static TITLE = 'title';
public static USER_CODE = 'user_cd';
public static TYPE4 = 'type4';
I have stuck at below code
filename = "file.json"
with open(filename) as f:
contents = f.read()
contents = contents.split(':')
print(contents)