Skip to content

Instantly share code, notes, and snippets.

@imanabu
Created August 14, 2019 20:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imanabu/b6f13f79d498dfd140f89f9ff2b3b1d0 to your computer and use it in GitHub Desktop.
Save imanabu/b6f13f79d498dfd140f89f9ff2b3b1d0 to your computer and use it in GitHub Desktop.
Python Dir Exists and Scan Directory
import os
import os.path
from pathlib import Path
if not Path.exists(Path(image_source_dir)):
raise Exception(f"The source not found: {image_source_dir}. Please correct this in Migrate.py")
index = 0
previousInfo: ImageInfo = None
for ent in Path(image_source_dir).iterdir():
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment