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!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.011 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'importing': 0.05; 'imported': 0.09; 'subject:into': 0.09; 'subject:script': 0.09; 'python': 0.11; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'message- id:@mrabarnett.plus.com': 0.16; 'received:192.168.1.4': 0.16; 'received:84.93': 0.16; 'received:84.93.230': 0.16; 'wrote:': 0.18; 'import': 0.22; 'header:User-Agent:1': 0.23; 'subject: .': 0.24; 'script': 0.25; 'compiled': 0.26; 'gets': 0.27; 'header:In- Reply-To:1': 0.27; 'run': 0.32; 'received:84': 0.35; 'to:addr :python-list': 0.38; 'pm,': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'it!': 0.67; 'header :Reply-To:1': 0.67; 'sam': 0.68; 'reply-to:no real name:2**0': 0.71; 'compiling': 0.84; 'reply-to:addr:python.org': 0.84 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.1 cv=dYa5gxne c=1 sm=1 tr=0 a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=0Bzu9jTXAAAA:8 a=5FYZ9MsUIQAA:10 a=Z5Iqsg1z1tkA:10 a=ihvODaAuJD4A:10 a=OUOv7kDek9cA:10 a=IkcTkHD0fZMA:10 a=EBOSESyhAAAA:8 a=8AHkEIZyAAAA:8 a=sCouXtKQzR0A:10 a=9Fszi2kVYSGzQ-0phI4A:9 a=QEXdDO2ut3YA:10 a=IZy5m2NUwEsA:10 a=MjtxP_AdsOsA:10 X-AUTH: mrabarnett:2500 Date: Fri, 17 Jan 2014 03:19:31 +0000 From: MRAB User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Compiling main script into .pyc References: <61a24c80-12fd-4c7a-89ed-41e997b66545@googlegroups.com> <52D89BC2.4000602@gmail.com> In-Reply-To: <52D89BC2.4000602@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: python-list@python.org 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: 9 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1389928778 news.xs4all.nl 2933 [2001:888:2000:d::a6]:36635 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:64136 On 2014-01-17 02:56, bob gailer wrote: > On 1/16/2014 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? > Duh? Just import it! > What if you want to just compile it? Importing will run it!