Python Project Directory Setup

Create a Directory

mkdir new-py-proj

Create a .gitignore to ignore python virtualenv and pip module directories

cat << EOM >> .gitignore
bin/
include/
lib/
pip-selfcheck.json
EOM

Create docs and classes Directories

mkdir docs config log classes tests results db

Initialise a Python Virtual Environment

virtualenv -p /usr/bin/python3 .

Activate the VirtualEnv

This ensures any pip modules you download are stored in ./bin in the virtualenv

. bin/activate

Install some modules

pip install requests

Save required Modules to File that can be installed at a later date

pip freeze > requirements.txt

Create Initial README.md

cat << EOM >> README.md
### Python APP X

Purpose
-------

Installation
------------

Notes
-----

EOM

Pull a fresh Python .gitignore

curl -o .gitignore https://raw.githubusercontent.com/github/gitignore/master/Python.gitignore

Initialise a git repo

git init

Add Files and Create Initial Commit

git add --all
git commit -m "Inital Commit"