Skip to content

Instantly share code, notes, and snippets.

@timvw
Last active May 15, 2024 09:33
Show Gist options
  • Save timvw/a71c222b93c11e7d0d2b0f0b02220ea6 to your computer and use it in GitHub Desktop.
Save timvw/a71c222b93c11e7d0d2b0f0b02220ea6 to your computer and use it in GitHub Desktop.
python importlib for modules with keyword in path
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
models = importlib.import_module("api.lambda.models")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment