I am brand new to Python, and decided to jump headfirst into a small project. I'm using Tkinter to make a GUI, and I will have a score that updates when certain things are done on a VM.
Problem- I am trying to have a variable be updated (Higher Score) when a file is not present on the computer. I have the file present, but it always tells me that it's not there. When I try and print the variable, the score isn't where it should be.
I've been looking for a way to fix this, but I haven't found anything.
Here is my code-
import tkinter as tk
window = tk.Tk()
# Heading
Word = tk.Label(text="Score: ")
Word.pack()
# Variable for score
x = 0
Score = tk.Label(text=x)
Score.pack()
# File exists
# Issue: Files always maked as false
import os
PATH = 'file.txt'
if os.path.isfile(PATH) and os.access(PATH, os.R_OK):
p(x + 0)
else:
(x + 10)
print(x)
window.mainloop()import os