obviscating python code for distribution

Ben Finney ben+python at benfinney.id.au
Sun May 15 23:29:49 EDT 2011


"Littlefield, Tyler" <tyler at tysdomain.com> writes:

> I have been considering writing a couple of programs in Python, but I
> don't want to distribute the code along with them.

This topic has been raised many times before, and there is a response
which is now common but may sound harsh:

What is it you think you would gain by obfuscating the code, and why is
that worthwhile? What evidence do you have that code obfuscation would
achieve that?

> Finally, is there a good way to accomplish this? I know that I can
> make .pyc files, but those can be disassembled very very easily with
> the disassembler and shipping these still means that the person needs
> the modules that are used. Is there another way to go about this?

Not really, no. You would be best served by critically examining the
requirement to obfuscate the code at all.

-- 
 \                 “Leave nothing to chance. Overlook nothing. Combine |
  `\          contradictory observations. Allow yourself enough time.” |
_o__)                                                     —Hippocrates |
Ben Finney



More information about the Python-list mailing list