Spaces:
Runtime error
Runtime error
Commit
·
39a3ca0
1
Parent(s):
52b9ae9
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
|
| 3 |
+
@st.cache
|
| 4 |
+
def get_syntax(text):
|
| 5 |
+
return text + '\n'
|
| 6 |
+
|
| 7 |
+
st.write('Enter your code:')
|
| 8 |
+
code = st.text_area()
|
| 9 |
+
|
| 10 |
+
if st.button('Write code'):
|
| 11 |
+
with st.spinner('Writing code...'):
|
| 12 |
+
syntax = get_syntax(code)
|
| 13 |
+
|
| 14 |
+
st.success('Done!')
|
| 15 |
+
st.code(syntax, language='python')
|