Skip to content

Instantly share code, notes, and snippets.

@leblowl
Last active August 29, 2015 14:26
Show Gist options
  • Save leblowl/cbd047c8633d5b321ec7 to your computer and use it in GitHub Desktop.
Save leblowl/cbd047c8633d5b321ec7 to your computer and use it in GitHub Desktop.
Python startup script for interpreting a build.py file
# build_init.py
# python startup script for interpreting a build.py file
#
# Install:
# download, place this file where you like,
# & then add the path to PYTHONSTARTUP env variable.
# ex:
# export PYTHONSTARTUP=$HOME/.config/python/build_init.py
#
# build.py:
# env = {'source_paths': ['src', 'test']}
#
import sys, os, os.path as path, build
def init_path(env):
for path in env.get('source_paths'):
sys.path.append(os.path.abspath(path))
init_path(build.env)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment