Run python script in background

I have a simple python script that makes POST and GET requests. It also calls termux-clipboard-get and termux-clipboard-set. It works fine when in the app but fails to run in the background. The script runs but termux-clipboard-get is empty. How can I keep it running in the background 24/7? I can rewrite it in bash if that helps. Any help would be much appreciated. Thanks.