File size: 1,648 Bytes
250011d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import streamlit as st
import pandas as pd

# Function to generate the form and allow downloading
def generate_form():
    st.title("IT, AI, and ML Training Topics Survey")

    # Creating the form inputs
    student_name = st.text_input("Enter Your Name:")
    student_email = st.text_input("Enter Your Email:")

    # Multi-select for IT, AI, ML topics
    it_topics = st.multiselect(
        "Select topics you're interested in under IT:",
        ["Cloud Computing", "Networking", "Cybersecurity", "Web Development", "Software Engineering", "Database Management"]
    )

    ai_ml_topics = st.multiselect(
        "Select topics you're interested in under AI/ML:",
        ["Deep Learning", "Natural Language Processing", "Computer Vision", "Reinforcement Learning", "Data Science", "Neural Networks"]
    )

    # Preparing the data for download
    if st.button("Generate Form"):
        if student_name and student_email:
            # Save the data to a DataFrame
            data = {
                "Name": [student_name],
                "Email": [student_email],
                "IT Topics": [", ".join(it_topics)],
                "AI/ML Topics": [", ".join(ai_ml_topics)],
            }
            df = pd.DataFrame(data)

            # Provide a download button
            st.download_button(
                label="Download Your Form as CSV",
                data=df.to_csv(index=False).encode('utf-8'),
                file_name="survey_results.csv",
                mime="text/csv"
            )
        else:
            st.error("Please fill in your name and email.")

# Call the function to generate the form
generate_form()