Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'imported': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:into': 0.09; 'subject:script': 0.09; 'python': 0.11; '.py': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'thread,': 0.16; 'files.': 0.16; 'wrote:': 0.18; 'library': 0.18; 'module': 0.19; 'header:User-Agent:1': 0.23; 'received:comcast.net': 0.24; 'subject: .': 0.24; 'script': 0.25; 'compiled': 0.26; 'gets': 0.27; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'another': 0.32; 'but': 0.35; 'to:addr:python-list': 0.38; 'files': 0.38; 'pm,': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'sam': 0.68; 'compiling': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Ned Batchelder Subject: Re: Compiling main script into .pyc Date: Thu, 16 Jan 2014 22:07:44 -0500 References: <61a24c80-12fd-4c7a-89ed-41e997b66545@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: c-50-133-228-126.hsd1.ma.comcast.net User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 In-Reply-To: <61a24c80-12fd-4c7a-89ed-41e997b66545@googlegroups.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1389928080 news.xs4all.nl 2850 [2001:888:2000:d::a6]:33867 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:64135 On 1/16/14 8:01 PM, 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. > The standard library has the compileall module that can be used to create .pyc files from .py files, but as we've been discussing in another thread, you may not want .pyc files. -- Ned Batchelder, http://nedbatchelder.com