Skip to content

Instantly share code, notes, and snippets.

@happysundar
Created March 19, 2014 21:57
Show Gist options
  • Save happysundar/9652296 to your computer and use it in GitHub Desktop.
Save happysundar/9652296 to your computer and use it in GitHub Desktop.
import subpackage
#
# use this if you want to include modules from a subfolder
#
__ = os.path.abspath(sys.argv[0])
while os.path.dirname(__) != __:
if os.path.exists(os.path.join(__, 'common', '__init__.py')):
sys.path.insert(0, __)
break
__ = os.path.dirname(__)
#
#
#
try:
from common import prints, formats, env
except ImportError:
exit("This script requires that the source code for common package (present in the SVN source, under ../common) be checkout, and available in PYTHONPATH")
env.check_env()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment