Simple devcontainer for Python development.
Note that Python + WASM is a little different for now, since the interperter (python.wasm
) runs a standard .py
python script.
There is no really great way to package up a script and python.wasm
into a single bundle for now, so that is sadly an exercise
for the reader.
Just click the button:
Note this assumes that you have the VS code support for remote containers and docker
installed
on your machine.
git clone https://github.com/dev-wasm/dev-wasm-python
cd dev-wasm-python
code ./
Visual studio should prompt you to see if you want to relaunch the workspace in a container, you do.
./python3-wasm main.py
There is a simple example of web serving via WebAssembly + CGI (WAGI) in
the webserver
directory. It uses the lighttpd web server and mod_cgi
.
See the webserver/lighttpd.conf
file for more details.
lighttpd -D -f webserver/lighttpd.conf
Once the server is running, VS Code or Codespaces should prompt you to connect to the open port.
It is important to note that the current configuration allows filesystem access to a variety of filepaths for both read and write. This should be considered for test use only, we need to lock down to read-only access for production.
- Figure out how to get PIP working
- Figure out how to package Python + script as a single .wasm file