-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstreamlit_app.py
More file actions
24 lines (20 loc) · 855 Bytes
/
streamlit_app.py
File metadata and controls
24 lines (20 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import streamlit as st
def table_to_str(table_text):
rows = table_text.strip().split('\n')
split_rows = [row.split('\t') for row in rows]
joined_rows = ['&'.join(cols) for cols in split_rows]
result = '@'.join(joined_rows)
return f'[■({result})]'
st.title("Excel spreadsheet -> Word matrix :)")
st.write("1.")
user_input = st.text_area("Paste your table here (paste from excel):", height=200)
if st.button("Format"):
if user_input.strip():
formatted = table_to_str(user_input)
st.code(formatted, language="text")
else:
st.warning("Please enter some data.")
st.write('2. Press "Format" 3. simply paste into a word equation editor box and press space')
st.write('tip: use the copy button at the end of the textbox to copy without format(recommended)')
st.image('copy.png')
st.write('Love from 11C')