Skip to content

Instantly share code, notes, and snippets.

@stevepiercy
Created May 20, 2018 23:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevepiercy/f41ddd279fc4fbcad7a213c51702f381 to your computer and use it in GitHub Desktop.
Save stevepiercy/f41ddd279fc4fbcad7a213c51702f381 to your computer and use it in GitHub Desktop.
PyEugene - Setting up a Python development environment - 2018-05-21
Slides
------
https://docs.google.com/presentation/d/1WS_nFfSn5MDf-Ic5ePLuCh_H7vdTaQTR0UyzFCgO8EY/edit?usp=sharing
Commands
--------
export ENV=${PWD}/env
echo $ENV
python3 -m venv $ENV
tree -C -L 3 env
$ENV/bin/pip install --upgrade pip setuptools
$ENV/bin/pip install pyramid
$ENV/bin/pip install cookiecutter
$ENV/bin/cookiecutter gh:Pylons/pyramid-cookiecutter-alchemy
hello.py
--------
from wsgiref.simple_server import make_server
from pyramid.config import Configurator
from pyramid.response import Response
def hello_world(request):
return Response('Hello World!')
if __name__ == '__main__':
with Configurator() as config:
config.add_route('hello', '/')
config.add_view(hello_world, route_name='hello')
app = config.make_wsgi_app()
server = make_server('0.0.0.0', 6543, app)
server.serve_forever()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment