Compiling main script into .pyc

Alister alister.ware at ntlworld.com
Fri Jan 17 12:04:36 EST 2014


On Thu, 16 Jan 2014 17:01:51 -0800, Sam wrote:

> One thing I observe about python byte-code compiling is that the main
> script does not gets compiled into .pyc. Only imported modules are
> compiled into .pyc.
> 
> May I know how can I compile the main script into .pyc? It is to
> inconvenience potential copy-cats.

if you want to stop casual programmers reading your code to see how you 
have achieved something don't bother.

1) your code is not that 'Clever'(Hopefully)
2) 'Clever' code is seldom worth copying *

* 'Clever' code usually makes use of obscure functions, side effects & 
other features that make it difficult to follow & maintain
just skim through www.thedailywtf.com for examples of 'Clever' code that 
should never have seen the light of day.

if you have found a straight forward way to achive complex goal such that 
it is worth copying rest assured it will be copied no mater how hard you 
try to protect it.





-- 
#define SIGILL 6         /* blech */
             -- Larry Wall in perl.c from the perl source code



More information about the Python-list mailing list