I think double clicking is part of your operating system, and you need to ensure that your operating system knows what to do with python files.
You have to remember that to the operating system, the python file is a simply a block of plain text. (probably wirth a py extension)
In most cases though these steps will resolve the issue.
First, make sure the first line of your python script has a correcr shebang line - it probably should using Linux/MacOs. This is less important on Windowns.
Secondly, make sure the file is marked as executable by you - on Linux/MacOs this command chmod+x <script.py> should be sufficient. On Windowns use the File Explore to change the permissions.
On Windowns also use settings to set that Windowns should open '.py' files using Python.
Finally, if you have done all of this and your python file still doesn't appear to run correctly, then it is worth looking at exactly what your script does. For instance a script that only genmerates output to a terminal, won't necessarily keep that terminal open after the script stops - so you might need to insert a pause or some form of delay in order to see the output. It also might be worth changing your script so that generates a log file, so that you can get more information about what happens when it executes.