Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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