TLDR: You don't.
This isn't normally done; applications that you double click are usually compiled so that the source code isn't there anymore, instead it's been turned into machine-readable instructions for the computer. Since python code is source code, it's simply not designed to be run like an app.
You can compile your python code into an app every time you want to use it, using something like py2app but then the source-code inside isn't easily editable and it may be fiddly to get complex imports working with this, or multiple python versions. I wouldn't get into the habit of this.
Instead, to run a python file, use the Terminal, and type python file_location
where file_location
is the path to the file. Alternatively you could navigate in the Terminal to the directory containing your python file and then just use python file_name
where file_name
is the name of your file.
Only compile your python work into an app when it's at its final stage and ready for "release".
For example, what if your app prints something to the command line? Without running it from the command line where would python print that information? Or what if something goes wrong in it and it returns an error; where would that error message go? Also the newer versions of Mac and their "System Integrity Protection" can make life difficult for bundled apps.