Debug python in visual studio code#
In what follows, I’ll describe an example of development in containers using Visual Studio Code (VS Code). Through development in containers one can perform code changes from within a container and when done with modifications, voilà, the updated application is ready to be run and deployed! The coding equivalent of this idea is remote development in containers. Wouldn’t it be nice to… magically enter the bottle and carry out all the desired changes to the ship while inside the bottle? However, if the ship doesn’t fit (the code crashes) or needs upgrades (new functionality), one needs to take it out and then inside the bottle again (modify the code, build and rerun the container), and again, and again… Working locally on code which eventually will be running in a container can feel a bit like building and upgrading a model ship that needs to fit inside a bottle: one can build the ship (create the initial version of the code), put it in the bottle (build the container with the code) check if it fits inside nicely (run the code successfully in the container). For example, to see how newly applied code changes affect the behavior of the app one would need to rebuild and rerun the container, and this can be slow and inefficient. There’s a small catch though: it can be cumbersome to develop code of a containerized application, because outside the container there won’t be an environment able to run it. How do you fix a ship if it’s inside a bottle?