the “cwd” (change working directory) point to the app.Note that assuming the command to run web service 1 is “python app.py 8964” I would like to share my launch.json (simplified): Idea is having Visual Studio Code to run the workspace in WSL (remotely), and setup the Python Extension and launch.jsonįor how to setup Visual Studio Code to remote to WSL and setup extension, follow the official document, it’s very clear. When using Visual Studio Code, it can detect the WSL environment for terminal shell, but when it comes to debug launch.json setup, it does not recognize the virtual environments in my WSL. I use Conda to manage my Python package, and the environments are all in file system inside WSL. So a usefull trick is to setup a dedicated appdebugvscode.py file for debugging. I use Windows, but I prefer Linux when I develop, so I use WSL (Window Linux Subsystems) Adding and removing the ptvsd code above can be cumbersome. I used to debug very inefficiently with adding pdb set_trace lines or print message to trace, but with Visual Studio Code as my major IDE (mainly for Javascript), I would like to leverage it to make my Python programming more efficient. I have this Python project that run multiple web services on Flask. Visual Studio Code - Debug (multiple) Python with Conda Env in WSL Background
0 Comments
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |