It's a script to move a file to another directory. How can I implement a checker, that checks if 'LiveryPath.txt' and 'OutputPath.txt' is empty?
import shutil
import ctypes
import time
with open("LiveryPath.txt","r") as f:
Livery = f.read()
with open("Output.txt","r") as g:
Output = g.read()
root_src_dir = Livery
root_dst_dir = Output
for src_dir, dirs, files in os.walk(root_src_dir):
dst_dir = src_dir.replace(root_src_dir, root_dst_dir, 1)
if not os.path.exists(dst_dir):
os.makedirs(dst_dir)
for file_ in files:
src_file = os.path.join(src_dir, file_)
dst_file = os.path.join(dst_dir, file_)
if os.path.exists(dst_file):
if os.path.samefile(src_file, dst_file):
continue
os.remove(dst_file)
shutil.move(src_file, dst_dir)
time.sleep(3)
ctypes.windll.user32.MessageBoxW(0, "Your Livery is now installed!", "Success!", 64) ```