File size: 650 Bytes
19243e6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# app.py
import streamlit as st
import pandas as pd
import numpy as np

def main():
    st.title("My Streamlit App")
    
    st.write("## Data Visualization Example")
    
    # Generate sample data
    chart_data = pd.DataFrame(
        np.random.randn(20, 3),
        columns=['A', 'B', 'C']
    )
    
    # Display line chart
    st.line_chart(chart_data)
    
    # Add a slider
    age = st.slider('How old are you?', 0, 130, 25)
    st.write("I'm ", age, 'years old')
    
    # Add a text input
    user_input = st.text_input('Enter some text', 'Type here...')
    st.write('You entered: ', user_input)

if __name__ == "__main__":
    main()