Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #25056
| Path | csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <rosuav@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.002 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'paths': 0.05; 'say,': 0.05; 'executed': 0.07; 'python': 0.09; 'explanation': 0.09; 'open()': 0.09; 'rules.': 0.09; 'yeah,': 0.09; 'looked': 0.10; 'language': 0.14; '"python': 0.16; '.py': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'means.': 0.16; 'merely': 0.16; 'pathname': 0.16; 'roy': 0.16; 'subject:Discussion': 0.16; 'mon,': 0.16; 'string': 0.17; 'wrote:': 0.17; 'directory.': 0.17; 'passes': 0.17; 'file.': 0.20; 'received:209.85.214.174': 0.21; 'subject:Code': 0.22; 'example': 0.23; 'script': 0.24; 'tried': 0.25; 'header:In-Reply-To:1': 0.25; '(which': 0.26; 'am,': 0.27; 'entries': 0.27; 'message- id:@mail.gmail.com': 0.27; 'this?': 0.28; 'actual': 0.28; 'chris': 0.28; 'run': 0.28; 'implies': 0.29; 'strings,': 0.29; 'subject:some': 0.29; 'though.': 0.29; 'gets': 0.32; 'file': 0.32; 'could': 0.32; 'explains': 0.33; 'to:addr:python-list': 0.33; 'another': 0.33; 'received:google.com': 0.34; 'text': 0.34; 'path': 0.35; 'open': 0.35; 'received:209.85': 0.35; 'ability': 0.36; 'but': 0.36; 'operating': 0.36; 'does': 0.37; 'two': 0.37; 'uses': 0.37; 'quite': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'skip:o 20': 0.38; 'things': 0.38; 'to:addr:python.org': 0.39; 'received:209.85.214': 0.39; 'called': 0.39; 'header:Received:5': 0.40; 'your': 0.60; 'card': 0.62; 'between': 0.63; 'perfect': 0.63; 'jul': 0.65; 'gathering': 0.71; 'smith': 0.71; 'million': 0.72; 'article': 0.78; 'resolution,': 0.84; 'hopes': 0.91; 'from.': 0.93 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=UXX4e04p78yHRQbgXnx7xzAGCkDW6G75Uc82f8YkWXc=; b=jsPabm5q3mUqPmPRvtsLXsSOMpOK4GSWAd5yVUocZSVWBUPSx8B6RwYS7VAZTAbOPH yRTQAEJZcm0efPs6njUHW4juuBKTKqHQhn7kCquKefv0DmMDKM/CNTeKlHG7Qd+BnxXH VKLpap5Mbs5Sz4bbscBvR2hivQ0cyuyzphuMbAyeGoSFHugSr76yUjlHRsyisXRiAVHd iQK+DssnSO73Q23s/NWu46iXWbKiS7YtjrESdZQq9l201OD4NXyXLSEgcbwE0ir1t71R dytCxzF2Gz1BHUAvzHtFt1xwDF+n2aEiP0RLpG7njXrW9nvSSGjQVhzWW3i3pYtoAsBR njcQ== |
| MIME-Version | 1.0 |
| In-Reply-To | <roy-249FE5.14174108072012@news.panix.com> |
| References | <a4f0e2a9-cc3b-4081-beb9-82f229e95ba1@googlegroups.com> <3c4e2ef9-bf7e-4fbc-bf12-6780fdc3e5d4@googlegroups.com> <mailman.1901.1341694286.4697.python-list@python.org> <09adb3cf-f3f2-4acc-b561-a36dcf15ecc7@googlegroups.com> <mailman.1910.1341734607.4697.python-list@python.org> <11832de7-a064-494e-b3e8-32a2f15a6902@googlegroups.com> <mailman.1922.1341767824.4697.python-list@python.org> <roy-249FE5.14174108072012@news.panix.com> |
| Date | Mon, 9 Jul 2012 07:54:47 +1000 |
| Subject | Re: Discussion on some Code Issues |
| From | Chris Angelico <rosuav@gmail.com> |
| To | python-list@python.org |
| Content-Type | text/plain; charset=ISO-8859-1 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.12 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://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 | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1930.1341784495.4697.python-list@python.org> (permalink) |
| Lines | 35 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1341784495 news.xs4all.nl 6936 [2001:888:2000:d::a6]:48868 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:25056 |
Show key headers only | View raw
On Mon, Jul 9, 2012 at 4:17 AM, Roy Smith <roy@panix.com> wrote:
> In article <mailman.1922.1341767824.4697.python-list@python.org>,
> Chris Angelico <rosuav@gmail.com> wrote:
>
>> open("doc1.txt","r")
>>
>> Python will look for a file called doc1.txt in the directory you run
>> the script from (which is often going to be the same directory as your
>> .py program).
>
> Well, to pick a nit, the file will be looked for in the current working
> directory. This may or may not be the directory you ran your script
> from. Your script could have executed chdir() between the time you
> started it and you tried to open the file.
>
> To pick another nit, it's misleading to say, "Python will look for...".
> This implies that Python somehow gets involved in pathname resolution,
> when it doesn't. Python just passes paths to the operating system as
> opaque strings, and the OS does all the magic of figuring out what that
> string means.
Two perfectly accurate nitpicks. And of course, there's a million and
one other things that could happen in between, too, including
possibilities of the current directory not even existing and so on. I
merely oversimplified in the hopes of giving a one-paragraph
explanation of what it means to not put a path name in your open()
call :) It's like the difference between reminder text on a Magic: The
Gathering card and the actual entries in the Comprehensive Rules.
Perfect example is the "Madness" ability - the reminder text explains
the ability, but uses language that actually is quite incorrect. It's
a better explanation, though.
Am I overanalyzing this? Yeah, probably...
ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Discussion on some Code Issues subhabangalore@gmail.com - 2012-07-04 16:21 -0700
Re: Discussion on some Code Issues Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-07-05 00:02 +0000
Re: Discussion on some Code Issues Rick Johnson <rantingrickjohnson@gmail.com> - 2012-07-04 17:08 -0700
Re: Discussion on some Code Issues subhabangalore@gmail.com - 2012-07-04 20:25 -0700
Re: Discussion on some Code Issues Peter Otten <__peter__@web.de> - 2012-07-05 09:30 +0200
Re: Discussion on some Code Issues subhabangalore@gmail.com - 2012-07-05 07:33 -0700
Re: Discussion on some Code Issues subhabangalore@gmail.com - 2012-07-05 07:33 -0700
Re: Discussion on some Code Issues Peter Otten <__peter__@web.de> - 2012-07-06 09:35 +0200
Re: Discussion on some Code Issues subhabangalore@gmail.com - 2012-07-07 12:54 -0700
Re: Discussion on some Code Issues Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-07-07 16:51 -0400
Re: Discussion on some Code Issues subhabangalore@gmail.com - 2012-07-07 22:42 -0700
Re: Discussion on some Code Issues Chris Angelico <rosuav@gmail.com> - 2012-07-08 18:03 +1000
Re: Discussion on some Code Issues subhabangalore@gmail.com - 2012-07-08 10:05 -0700
Re: Discussion on some Code Issues Chris Angelico <rosuav@gmail.com> - 2012-07-09 03:17 +1000
Re: Discussion on some Code Issues Roy Smith <roy@panix.com> - 2012-07-08 14:17 -0400
Re: Discussion on some Code Issues Chris Angelico <rosuav@gmail.com> - 2012-07-09 07:54 +1000
Re: Discussion on some Code Issues Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-07-09 00:57 +0000
Re: Discussion on some Code Issues Chris Angelico <rosuav@gmail.com> - 2012-07-09 18:41 +1000
Re: Discussion on some Code Issues Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-07-09 12:24 +0000
Re: Discussion on some Code Issues Chris Angelico <rosuav@gmail.com> - 2012-07-10 00:47 +1000
Re: Discussion on some Code Issues Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-07-09 12:49 -0400
Re: Discussion on some Code Issues subhabangalore@gmail.com - 2012-07-16 07:17 -0700
Re: Discussion on some Code Issues subhabangalore@gmail.com - 2012-07-16 07:17 -0700
Re: Discussion on some Code Issues MRAB <python@mrabarnett.plus.com> - 2012-07-08 19:27 +0100
Re: Discussion on some Code Issues subhabangalore@gmail.com - 2012-07-08 10:05 -0700
Re: Discussion on some Code Issues Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-07-08 15:07 -0400
Re: Discussion on some Code Issues subhabangalore@gmail.com - 2012-07-07 22:42 -0700
csiph-web