There are several ways to protect your python scripts. The most common is pyarmor. There is no a solution yet for this protection but other protection methods can be easily be decoded.
The developer of the featured image in this article for example, uses iterative cryptographic methods with data compression to protect his code. The way we work is pretty similar to decoding similar scripts in other programming languages. Just replace evaluating commands with printing commands and get the source code!