Найти - Пользователи
Полная версия: Ошибка "Expecting value: line 1 column 1 (char 0)" . Помогите ...
Начало » Python для новичков » Ошибка "Expecting value: line 1 column 1 (char 0)" . Помогите ...
1
DEATHILAND
import json
file_name = ‘name.json’
try :
with open(file_name) as f:
username = json.load(f)
except FileNotFoundError:
username = input(“Whats is your name ? ”)
with open(file_name,'w') as f:
json.dump(username,f)
print (f“So im wait you {username}”)
else:
print(f“Welcome back , dear {username}”)
ntram
VANISHED
FishHook
DEATHILAND
     username = input("Whats is your name ? ") 
    with open(file_name,'w') as f:
        json.dump(username,f)
        print (f"So im wait you {username}")

то есть вы открыли файл file_name, а джейсон дампите в username
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB