Skip to content

Instantly share code, notes, and snippets.

@ErinLMoore
Created March 21, 2017 20:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ErinLMoore/0d34dbae99fe9dc498cf81c2d48fca59 to your computer and use it in GitHub Desktop.
Save ErinLMoore/0d34dbae99fe9dc498cf81c2d48fca59 to your computer and use it in GitHub Desktop.
A bash script to quickly stand up a small python module.
PROJECT_NAME=${1:-Python_Project}
#PROJECT_NAME_LOWER=`echo "$PROJECT_NAME" | tr '[:upper:]' '[:lower:]'`
mkdir $PROJECT_NAME
cd $PROJECT_NAME
echo "import sys\nsys.path.append('~\_________')\nfrom src.$PROJECT_NAME import _______\n\nclass main():" > main.py
touch main.py
mkdir src
mkdir test
cd src
touch __init__.py
touch $PROJECT_NAME.py
cd ..
cd test
touch __init__.py
echo "import unittest\nfrom src.$PROJECT_NAME import *\n\nclass test_$PROJECT_NAME(unittest.TestCase):" > "test_$PROJECT_NAME.py"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment