Hello,
This is a simple task to do, the requirements are the following :
- your Python code running on your computer must be listening on a port
- your computer and smartphone are on the same network OR that port on your computer is reachable online (ie: forwarded from your router to your computer)
All you need to do is await for HTTP requests for example with your Python code (or any other protocol but HTTP is simple) then send an HTTP request from your smartphone to the right address and the right port (ie : your computer's IP address and the port your Python code is listening on).
I can do all that for you via TeamViewer in about 2 hours.
Feel free to contact me without any commitment from your side, I can answer any question you have. If you feel you only need instructions and do it by yourself, I'd be glad to help without any charge.