Python 3.7 on Debian Stretch

To install the latest python on Debian (python 3.7 in this case) we need to go through a few steps.
First install some dependencies.

sudo apt-get install -y libffi-dev libbz2-dev liblzma-dev libsqlite3-dev libncurses5-dev libgdbm-dev zlib1g-dev libreadline-dev libssl-dev tk-dev build-essential libncursesw5-dev libc6-dev openssl git

Next download python 3.7 and extract it.

wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz
tar xvf Python-3.7.0.tar.xz
cd Python-3.7.0

Configure, make and make install

./configure --enable-optimizations --with-ensurepip=install
make -j8
sudo make altinstall

Update your update-alternatives
Use whereis python to find the location of your binaries

update-alternatives --install /usr/bin/python python /usr/local/bin/python3.7 50
update-alternatives --install /usr/bin/python python /usr/bin/python2.7 40
update-alternatives --install /usr/bin/python python /usr/bin/python3.5 30

sources:
unix.stackexchange.com
www.scivision.co
image is the logo of python.org