Skip to content

Instantly share code, notes, and snippets.

@sandorex
Created January 28, 2022 10:08
Show Gist options
  • Save sandorex/9077c8749b7517fbb574d13ac21c89a9 to your computer and use it in GitHub Desktop.
Save sandorex/9077c8749b7517fbb574d13ac21c89a9 to your computer and use it in GitHub Desktop.
Python script that includes module from previous directory
#!/usr/bin/env python3
#
# PROJECT HERE
#
# LICENSE HERE
#
# python-script-template.py: Template for python scripts
# hack to include modules from previous directory, edit to your liking
import os, sys
from pathlib import Path
CURDIR = Path(os.path.dirname(__file__))
sys.path.append(str(CURDIR.absolute().parent))
from buildsystem import templater
if __name__ == '__main__':
# to remove os.join clutter
os.chdir(CURDIR)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment