Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| import pandas as pd | |
| st.set_page_config(page_title="CSV Viewer", layout="wide") | |
| st.title("Simple CSV Viewer") | |
| uploaded_file = st.file_uploader("Upload a CSV file", type=["csv"]) | |
| if uploaded_file is not None: | |
| try: | |
| df = pd.read_csv(uploaded_file) | |
| st.success("File successfully uploaded and loaded.") | |
| st.subheader("Preview of the uploaded CSV") | |
| st.dataframe(df) | |
| except Exception as e: | |
| st.error(f"Error reading the file: {e}") | |
| else: | |
| st.info("Please upload a CSV file to display its contents.") |