
How to Use Streamlit in VS Code Without Using the Command Line
This article provides a step-by-step guide on how to use Streamlit in VS Code without using the command line. It covers everything from adding the configuration to the launch.json file to running the configuration.
In this guide, we'll learn how to configure Streamlit in VS Code without relying on the command line. By adding the configuration to the launch.json file, you can seamlessly integrate Streamlit into your development workflow. If you don't already have a launch.json file, we'll walk you through creating one in your folder. Once set up, running Python code will automatically generate part of the launch configuration. To add a new configuration specifically for Streamlit, follow these steps: define a name for easy reference, use debug.py as the type, specify the Streamlit model imported into your project, and ensure the args include "run" followed by the file you want to execute. With the configuration in place, you can effortlessly run Streamlit within VS Code. Let's get started.
Let's get started.
Okay, today I'll show you how to use Streamlit in VS Code without using the command line. First, we need to add the configuration to the launch.json file. If you don't have a launch.json file, create one in your folder. I already have one prepared.

Once you create or run a Python code, an auto-generated launch configuration will appear.

To add a new one from Streamlit, you can do it as follows.



Define a name that is convenient for you to work with.

You can use the debug feature.

You should use the Streamlit model that you import into your project.

It is crucial to specify the arguments by first entering the command "run" followed by the file you wish to execute.


Once you have that, you can proceed to run the configuration.


Let's open the file.

You can see here we debug through the JSON. Then, you can see we have the two configurations.


Either run the current file or use the other configuration we use with Streamlit.

Once we have that, we have something that we can actually run.

That's it