So I made a program in windows as it gets bit laggy using realvnc to program with. I thought everything would be fine however when I tried to run my program on my raspberry pi 4b I got this error:Here is the code in requests.py that it is happening on:and in main.py:This code works perfectly in windows.
Thanks!
Code:
Error retrieving balance for wvzack: Expecting value: line 1 column 1 (char 0)
Code:
@client.requestdef get_balance(): try: balance = main.get_value(client.get_requester()) formatted_message = f"You have {balance} dollar(s)" return balance except Exception as e: print(f"Error retrieving balance for {client.get_requester()}: {e}") return "Error retrieving balance. Check the Python console for details."
Code:
def read_file(): f = open("data.txt", "r") file_contents = f.read() f.close() return(file_contents)def get_value(username): data = json.loads(read_file()) print(f"Loaded data: {data}") # Print the loaded data dictionary if data.get(username) == None: add_save(username, startmoney) else: print(f"Found user: {username}") # Print if user exists return data.get(username)
Thanks!
Statistics: Posted by wvzack — Sun Jun 02, 2024 11:49 pm — Replies 0 — Views 8