/basic-python-example

Files for June 3rd

Primary LanguageJavaScript

basic python example

  • files for 6/3/2015

Local Install (on OS X and Windows 8.1)

This is a quick checklist to install virtualenv and virtualevnwrapper on an OS X or Windows 8.1 machine.

Install pip

  • use sudo if needed
    • OS X: pip install -U pip or sudo easy_install pip
  • if on Windows, make sure python is installed.
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Devel
source /usr/local/bin/virtualenvwrapper.sh

or, on windows, this might be helpful.

Setup on the local machine

cd into the basic-python-example repository

cd ~\basic-python-example

Install the virtualenv and the requirements

This may take a minute or two. On Mac: Xcode needs to be installed.

mkvirtualenv basic-python-example
pip install -r requirements/base.txt

If you run into Xcode (or other errors) when running the install, google it. Sometimes the Xcode license agreement hasn't been accepted

Working with the project (post installation)

cd ~\basic-python-example\code
workon basic-python-example

Web example

Parse example

  • Open a Terminal/Shell
  • Go to directory \basic-python-example\code
    • With virtualenv activated (workon basic-python-example)
  • Type:
python

Basic server 1

  • Open a Terminal/Shell
  • Go to directory \basic-python-example\code
    • With virtualenv activated (workon basic-python-example)
  • Start Flask
python web_01.py

Basic server 2

  • Assume you are in directory \basic-python-example\code with virtualenv activated (workon basic-python-example)
  • Start Flask
python web_02.py