Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news2.arglkargh.de!news.ecp.fr!news.muarf.org!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'scripts': 0.03; 'imported': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'jan': 0.12; 'stored': 0.12; '"from': 0.16; '.py': 0.16; 'idle.': 0.16; 'imported.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'top-level': 0.16; 'when,': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'library': 0.18; 'import': 0.22; 'header:User-Agent:1': 0.23; 'compiled': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In- Reply-To:1': 0.27; 'went': 0.31; 'file': 0.32; 'noticed': 0.34; 'created': 0.35; 'form.': 0.35; 'module.': 0.36; 'possible': 0.36; 'to:addr:python-list': 0.38; 'files': 0.38; 'pm,': 0.38; 'short': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'received:173': 0.61; 'back': 0.62; 'received:fios.verizon.net': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: running python 2 vs 3 Date: Thu, 20 Mar 2014 17:52:02 -0400 References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-173-75-254-207.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 In-Reply-To: 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: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1395352349 news.xs4all.nl 2875 [2001:888:2000:d::a6]:41324 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:68629 On 3/20/2014 1:23 PM, notbob wrote: > What the heck is a .pyc file and how are they created? .pyc contained compiled bytecode. They are created when, and only when, you import a module. Imported library files are often big and stable, so their compiled forms get cached. Top-level scripts are typically short and often volotile. They may be as short as "from start import run; run()" in order to have as much as possible stored in compiled form. This has nothing to do with Idle. > I went back to my ~/python/ dir and noticed one .pyc file out of 15 > .py files I created from following Learning Python the Hard Way. That must be the only one you imported. -- Terry Jan Reedy