Forums

Need help with listeners

Hello, I need some advice on how to implement my work on PythonAnywhere

In my local project, i have a constantly running script that listens to a server for events. From the main.py, i will create an extra thread to host my Flask API to receive "POST" that will be passed onto the main function and instructs it to listen to a specific thing.

I am thinking to use Web function to run Flask to listen to API calls Then use Always on Console to listen to the server for events, but i'm not sure how can i pass the information from Web function to the Always on Console.

Please help me thanks :D

If you want an always-on task to pick up events from a running website, one trick is to use a database -- there is an outline of how that might work on this help page.