This is an ok solution if you want to bundle it so that it can easily be distributed and run. However, don't think that this is safe or secure for your source code as you can easily use a tool like github.com/extremecoders-re/pyinstxtractor and retrieve all your python code. It is a great easy to follow article and I have used pyinstaller as well, it is just something to keep in mind.