File size: 735 Bytes
a1ae122
 
 
 
 
 
 
 
 
 
 
 
cf3df88
 
bde821f
cf3df88
e907c17
a248213
38aea28
41ddb6a
b72511f
41ddb6a
0d97ef5
e907c17
 
a1ae122
 
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
#!/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)