Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed4.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.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'apis': 0.07; 'subject:file': 0.07; '22,': 0.09; 'python': 0.11; 'python.': 0.11; "'/'": 0.16; 'backslashes': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'message-id:@mrabarnett.plus.com': 0.16; 'options),': 0.16; 'received:192.168.1.4': 0.16; 'received:84.93': 0.16; 'received:84.93.230': 0.16; 'slashes': 0.16; 'subject: \n ': 0.16; 'subject:folder': 0.16; 'subject:sub': 0.16; 'yup,': 0.16; 'wrote:': 0.16; '>>>': 0.20; 'windows': 0.20; '(or': 0.21; 'am,': 0.23; '2015': 0.23; 'needed.': 0.23; "i've": 0.24; 'import': 0.24; 'header:In-Reply-To:1': 0.24; 'unix': 0.24; 'feature': 0.24; 'wondering': 0.25; 'header:User-Agent:1': 0.26; 'chris': 0.26; 'dos': 0.27; 'command': 0.28; 'this.': 0.28; 'subject:/': 0.29; 'command-line': 0.29; 'dialog': 0.29; 'them?': 0.29; 'character': 0.29; 'convert': 0.29; '(which': 0.29; 'fri,': 0.31; 'received:84': 0.32; "d'aprano": 0.33; 'steven': 0.33; 'surprised': 0.33; 'file': 0.34; 'could': 0.35; 'to:addr:python- list': 0.35; "isn't": 0.35; '(and': 0.36; 'heard': 0.36; 'quite': 0.37; 'subject:: ': 0.37; 'ok,': 0.37; "won't": 0.38; 'wanted': 0.39; 'whatever': 0.39; 'to:addr:python.org': 0.39; 'system.': 0.39; 'received:192': 0.39; 'subject:-': 0.39; 'where': 0.40; 'some': 0.40; 'back': 0.61; 'even': 0.61; 'day,': 0.62; 'forward': 0.65; 'due': 0.65; 'special': 0.72; 'introduce': 0.78; '2.7.': 0.84; 'actually,': 0.84; 'me).': 0.84; 'that)': 0.84; 'boxes,': 0.91; 'edwards': 0.91 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.1 cv=dZcO3Bne c=1 sm=1 tr=0 a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=0Bzu9jTXAAAA:8 a=QrohdLjRRo4A:10 a=IkcTkHD0fZMA:10 a=EBOSESyhAAAA:8 a=pGLkceISAAAA:8 a=kZ7UWmmPAAAA:8 a=u96MFOJ_ei8qps1ftjMA:9 a=QEXdDO2ut3YA:10 X-AUTH: mrabarnett@:2500 Date: Thu, 21 May 2015 17:54:01 +0100 From: MRAB User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Find if a file existing within 1000s of folder/sub-folder - each file has a unique presence References: <9d786d0b-0f25-4446-a730-ff1fe2f6b20d@googlegroups.com> <555d9233$0$12913$c3e8da3$5496439d@news.astraweb.com> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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: 40 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1432227244 news.xs4all.nl 2827 [2001:888:2000:d::a6]:54319 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:91017 On 2015-05-21 17:31, Grant Edwards wrote: > On 2015-05-21, Chris Angelico wrote: >> On Fri, May 22, 2015 at 12:14 AM, Grant Edwards wrote: >>> On 2015-05-21, Steven D'Aprano wrote: >>> >>>> import glob >>>> print(glob.glob("c:/abc/def/ghjmain/features/XYZ/*")) >>>> >>>> Don't use backslashes \ as they have special meaning to Python. Use forward >>>> slashes and let Python convert them as needed. >>> >>> Interesting. I've never heard about this. >>> >>> When will Python convert them? >> >> Actually, it won't ever bother to convert them. > > OK, so this isn't some new feature I hadn't heard about due to my > spending most of my time with 2.7. :) > >> The Windows file system APIs are quite happy to work with forward >> slashes; > > Yep, I knew that -- I have always use forward slashes on Windows (and > DOS before that) when dealing with the file system. > >> it's only command-line tools (which conventionally use forward >> slashes to introduce options), and not all of them, which require >> backslashes. > Dialog boxes, however, insist on backslashses. > Yup, I was wondering if that was where Python (or its stdlib) would > convert them (which would have surprised me). Back in the day, you > could change the 'option switch' character from '/' to whatever you > wanted (and as an old Unix guy, I always set it to '-'). Then you > could even use forward slashes on the command line (mostly). But, I > don't think Windows has support that for yonks. >