ppt / stream.py
shujath000's picture
Update stream.py
0d97ef5 verified
raw
history blame contribute delete
735 Bytes
#!/usr/bin/env python
# coding: utf-8
# In[4]:
import streamlit as st
import requests as req
import subprocess as s
st.title("ppt generator by shujath")
topic=st.selectbox(label="select topic",options=["AI","Python","Machine Learning","Deep Learning"])
but=st.button(label="submit")
if but:
res=req.post(url="https://shujju786.app.n8n.cloud/webhook-test/e8d75729-a08e-47af-8239-17002afdace5",json = {"topic": topic})
if res.status_code==200:
st.write(res.status_code)
d=res.json()
st.write(d["output"])
with open("pytho.py","w") as f:
f.write(d["output"])
result=s.run(["python", "pytho.py"])
st.write(result.stderr)
else:
st.write(res.status_code)