Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #69609

Re: Two Questions about Python on Windows

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <ethan@stoneleaf.us>
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; 'python,': 0.02; 'subject:Windows': 0.02; 'argument': 0.05; 'subject:Python': 0.06; 'correct.': 0.07; 'subject:Questions': 0.07; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'imported': 0.09; 'message-id:@stoneleaf.us': 0.09; 'method,': 0.09; '~ethan~': 0.09; 'python': 0.11; 'up-to-date': 0.14; '.py': 0.16; 'command-line': 0.16; 'created.': 0.16; 'extension,': 0.16; 'happily': 0.16; 'modules.': 0.16; 'second- guess': 0.16; 'specifying': 0.16; 'subject:Two': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'command': 0.22; 'header:User-Agent:1': 0.23; 'file.': 0.24; 'right.': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'specified': 0.30; 'file': 0.32; 'run': 0.32; 'could': 0.34; 'created': 0.35; 'to:addr:python-list': 0.38; 'files': 0.38; 'to:addr:python.org': 0.39; 'ian': 0.60; 'received:173': 0.61; 'believe': 0.68; 'line,': 0.68; 'received:69.56': 0.68
Date Thu, 03 Apr 2014 11:00:00 -0700
From Ethan Furman <ethan@stoneleaf.us>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1
MIME-Version 1.0
To python-list@python.org
Subject Re: Two Questions about Python on Windows
References <lhk4el$91k$1@news.albasani.net> <CALwzidmpCpLrR=0J+D1isKW_9kGeE=UyM3Q_wqm7xitHeRSCfg@mail.gmail.com>
In-Reply-To <CALwzidmpCpLrR=0J+D1isKW_9kGeE=UyM3Q_wqm7xitHeRSCfg@mail.gmail.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-AntiAbuse This header was added to track abuse, please include it with any abuse report
X-AntiAbuse Primary Hostname - gator3304.hostgator.com
X-AntiAbuse Original Domain - python.org
X-AntiAbuse Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse Sender Address Domain - stoneleaf.us
X-BWhitelist no
X-Source-IP 173.12.184.233
X-Exim-ID 1WVlwQ-0002Nv-OE
X-Source
X-Source-Args
X-Source-Dir
X-Source-Sender ([173.12.184.233]) [173.12.184.233]:43542
X-Source-Auth ethan+stoneleaf.us
X-Email-Count 1
X-Source-Cap dG9idWs7dG9idWs7Z2F0b3IzMzA0Lmhvc3RnYXRvci5jb20=
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.8854.1396554748.18130.python-list@python.org> (permalink)
Lines 15
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1396554748 news.xs4all.nl 2933 [2001:888:2000:d::a6]:52042
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:69609

Show key headers only | View raw


On 04/03/2014 10:54 AM, Ian Kelly wrote:
> On Apr 3, 2014 11:12 AM, "Walter Hurry" wrote:
>>
>> Secondly, on *ix, if there's an up-to-date .pyc in the right place and I run foo.py, Python will automagically use foo.pyc.
>
> I don't believe this is exactly correct. Python will only use a .pyc automatically for imported modules. For a file
> specified on the command line, Python won't try to second-guess the user as to which file they want.  The file could
> have a .php extension, and Python will happily run it if the contents are valid Python code.

Right.  When specifying the file as a command-line argument to python, you have it include the extension, and that is 
exactly the file that python executes.  Also, using this method, a .pyc file is not created.  Only imported files may 
have a .py[co] file automatically created for corresponding .py file.

--
~Ethan~

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Two Questions about Python on Windows Walter Hurry <walterhurry@gmail.com> - 2014-04-03 17:06 +0000
  Re: Two Questions about Python on Windows maxerickson@gmail.com - 2014-04-03 10:31 -0700
    Re: Two Questions about Python on Windows Tim Roberts <timr@probo.com> - 2014-04-05 14:57 -0700
  Re: Two Questions about Python on Windows Ian Kelly <ian.g.kelly@gmail.com> - 2014-04-03 11:54 -0600
  Re: Two Questions about Python on Windows Terry Reedy <tjreedy@udel.edu> - 2014-04-03 14:34 -0400
  Re: Two Questions about Python on Windows Ethan Furman <ethan@stoneleaf.us> - 2014-04-03 11:00 -0700
  Re: Two Questions about Python on Windows Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-04-03 21:15 +0100
  Re: Two Questions about Python on Windows Ian Kelly <ian.g.kelly@gmail.com> - 2014-04-03 16:41 -0600
  Re: Two Questions about Python on Windows Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-04-03 23:57 +0100

csiph-web