We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5f34b50 commit 8b945d6Copy full SHA for 8b945d6
src/main.py
@@ -50,9 +50,10 @@ def openfile(path):
50
btnopenlast = ttk.Button(root, text="Open last file", command=lambda: openfile(path=content))
51
btnopenlast.pack(anchor="nw", padx=20, pady=20)
52
53
-file = open("lastfile.txt", "r")
54
-content = file.read()
55
-file.close()
+if os.path.isfile("lastfile.txt"):
+ file = open("lastfile.txt", "r")
+ content = file.read()
56
+ file.close()
57
58
if not os.path.isfile(content): btnopenlast.configure(state="disabled")
59
0 commit comments