Converting working Python scripts to streamlit enabled web applications

So I use cursor allot for creating scripts that use OpenAI APIs to do scenario tests for students on various books and etc. Scipts work well on commandline but creating a streamlit front end so I can move the application to heroku is difficult. I need better ideas on how to make web front ends easier and get AI to perform better in generating these front ends for many scripts I have.