something not something
is not a valid expression. If you want to test if it is not equal, use !=
:
elif x['fname'] != 'ply.json':
However, since this is the exact opposite of the preceding if
test, just use else
here:
if x['fname'] == 'ply.json':
save1(name)
else:
write_data({'fname':'ply.json', 'name':'Karatepig'}, 'ply.json')