Hi,
Now that I seem to have Streamlit installed, I’m a bit confused as to how the various parts fit together (IDE, command line, local webpage) - specifically, what to do where to get an output on a local webpage.
I’m following the instructions on Main concepts - Streamlit Docs
I entered this code into my IDE (Thonny):
"""
# My first app
Here's our first attempt at using data to create a table:
"""
import streamlit as st
import pandas as pd
df = pd.DataFrame({
'first column': [1, 2, 3, 4],
'second column': [10, 20, 30, 40]
})
df
Then when I click ‘run’, shell returns the following:
2023-09-06 17:00:38.090
Warning: to view this Streamlit app on a browser, run it with the following
command:
streamlit run First Streamlit test.py [ARGUMENTS]
So first I added this line (streamlit run First Streamlit test.py ) to the bottom of my code and again clicked ‘run’ but that resulted in more errors (specifically, syntax errors).
Next, I added this code in the command line, that also resulted in errors:
Usage: streamlit run [OPTIONS] TARGET [ARGS]…
Try ‘streamlit run --help’ for help.
Error: Streamlit requires raw Python (.py) files, but the provided file has no extension.
So what do I do with the Python file I created (First Streamlit test.py ) to get it to display on the local webpage?
Separately (or maybe related?), in Thonny are many ‘extensions’, including Streamlit, should I also install it there? Would this help resolve the issue of displaying on a local webpage?
Thanks,
Mike