-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_file_exists.py
More file actions
30 lines (27 loc) · 853 Bytes
/
check_file_exists.py
File metadata and controls
30 lines (27 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Standard library imports
import datetime
import logging
import os
import shutil
import sys
import time
# Third-party library imports
import tkinter as tk
from tkinter import messagebox
from tkinter import ttk
from PIL import Image, ImageTk
# Local imports
from definitions import *
import importlib
import inspect
def check_file_exists(file_path):
if not os.path.exists(file_path):
error_window = tk.Toplevel(master=main_window)
error_window.title("Error")
error_label = ttk.Label(error_window, text="Please complete the steps in order before attempting this action.")
error_label.grid(padx=10, pady=10)
ok_button = ttk.Button(error_window, text="OK", command=error_window.destroy)
ok_button.grid(padx=10, pady=10)
return False
else:
return True