在学习python中遇到了问题json.decoder.JSONDecodeError: 不知道怎么弄,请大家帮忙看看

import json

filename = 'username.json'
try:
	with open(filename) as f:
		username = json.load(f)
except FileNotFoundError:
	username = input("what's your name?")
	with open(filename,'w') as f:
		json.dump(username,f)
		print("we'll remember you when you come back," + username +"!")
else:
print("welcome come backe, " + username + "!")			

代码如上 不晓得哪里错了请大佬们帮忙看看

你可能感兴趣的:(在学习python中遇到了问题json.decoder.JSONDecodeError: 不知道怎么弄,请大家帮忙看看)