Martin1998 commited on
Commit
dfda771
·
1 Parent(s): 44d3673

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -1
app.py CHANGED
@@ -10,4 +10,26 @@ st.write("---")
10
  st.write("### Give Content to the AI and quiz it based on the content.")
11
  st.warning("**Powered by AI Language Models...**")
12
 
13
- st.write("---")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  st.write("### Give Content to the AI and quiz it based on the content.")
11
  st.warning("**Powered by AI Language Models...**")
12
 
13
+ st.write("---")
14
+
15
+ import streamlit as st
16
+ import pandas as pd
17
+ from io import StringIO
18
+
19
+ uploaded_file = st.file_uploader("Choose a file")
20
+ if uploaded_file is not None:
21
+ # To read file as bytes:
22
+ bytes_data = uploaded_file.getvalue()
23
+ st.write(bytes_data)
24
+
25
+ # To convert to a string based IO:
26
+ stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))
27
+ st.write(stringio)
28
+
29
+ # To read file as string:
30
+ string_data = stringio.read()
31
+ st.write(string_data)
32
+
33
+ # Can be used wherever a "file-like" object is accepted:
34
+ dataframe = pd.read_csv(uploaded_file)
35
+ st.write(dataframe)