import streamlit as st import json def save_data(data, filename='data.json'): with open(filename, 'w') as f: json.dump(data, f, indent=4) def app(): st.title('Basic Information Form') with st.form("basic_info_form", clear_on_submit=False): name = st.text_input("Name") mobile_no = st.text_input("Mobile No") email_id = st.text_input("Email ID") linkedin = st.text_input("LinkedIn (optional)") github = st.text_input("GitHub (optional)") submit_button = st.form_submit_button(label='Submit') if submit_button: data = { "name": name, "mobile": mobile_no, "email": email_id, "linkedin": linkedin, "github": github } save_data(data) st.success("Thank you for submitting your information.") if __name__ == "__main__": app()