I made a small VS Code extension that lets you run Streamlit apps directly from the right-click menu. I found myself constantly opening terminals to run different apps during development, so I thought this might be helpful for others too.
Why not just create a debug config (.vscode/launch.json) - for either a specific file (for large projects with specific entry point) or for currently opened file - and press F5 to run it? You also get debugging breakpoints that way.
Updated: added sample config:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "debug streamlit",
"type": "python",
"request": "launch",
"program": ".\\.venv\\Scripts\\streamlit.exe", // "./.venv/bin/streamlit" on linux,
"args": [
"run",
"${file}" // "${file}" for the current file or specific file with relative path
]
}
]
}
I agree… on Windows I do it this way and have several of them in my launch.json because I want a selection of server ports (Why? Because I have a personal gists project with dozens of Streamlit apps all on the go… if you know of a way to randomize that port number, please let me know?)
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.