Embedded Python: How to use it effectively


I wanted to write a little about this, as I feel that the embedded Python distribution available since Python 3.5 is perhaps underappreciated by many in the community.

As an experienced Python dev, I understand the benefits of using a properly installed Python, or using virtualenvs. And I agree that those should be the main ways that developers, especially more inexperienced ones, should work with Python.

However, the embedded Python distribution has obvious benefits for certain cases. For example, if you want to distribute software in Python but don’t want to compile it to an EXE using py2exe or similar, using the embedded environment is an excellent way to enable end users to use your software without needing to know that the software is necessarily written in Python, or at least to not need to install a Python environment prior to using it, or to simply have a clean and isolated Python distribution which won’t interfere with others in the system.

For those who understand this, I think it’s perfectly fine to leverage this environment.

However, there’s a few issues with the embedded environment which can be cumbersome and annoying.

Here’s a few of them:


Getting started with Erlang and Cowboy on Windows (rebar3 edition)

This is a follow-up to my previous post about Erlang and Cowboy, except this time covering it with the rebar3 build tool.

First, let me predicate this a little bit. rebar3 is a cool build tool, and I like it because it’s pure Erlang (no special build environment needed on Windows) and because it supports hex.pm, the new package index for Erlang and Elixir. As I come from a heavy Python background, I love Python’s PyPI, and having something similar in Erlang seems like The Way To Go™. However, if your goal is simply to get up with Erlang and Cowboy in the quickest way possible, read my other post. Cowboy is set up to work with Erlang.mk and will require less set up in that environment (especially the Cowboy-specific templates) compared to the rebar3 approach.

Also be aware that there seem to be some intermittent certificate errors with hex.pm’s package server which causes TLS-related errors and may prevent you from pulling from the package manager server via rebar3. Hopefully this will be resolved soon…


Getting started with Erlang and Cowboy on Windows (erlang.mk edition)

This is the first in a series of posts on getting up and running writing microservices using Erlang and Cowboy, for those of us who chose to (or are required to) develop in a Windows environment.

Of course, one could get snarky and say “Install VirtualBox – done.” But let’s be a little more polite to the Windows users here. Windows is a supported platform for Erlang, so I want to provide assistance for those who choose, or need to use, Erlang in this way.

Without further ado…


Simple tricks: “cyghere”: open Cygwin shell here

I’m sure there’s other solutions out there, but I’ll share mine. Create a directory on your system and add it to your path. In my case, I use C:\scripts. Create a script, cyghere.bat, as follows (assuming cygwin is installed to C:\cygwin): Now, you can launch a cygwin shell from basically any program that lets you Read more about Simple tricks: “cyghere”: open Cygwin shell here[…]