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


Groups > comp.lang.python > #91011

Re: Find if a file existing within 1000s of folder/sub-folder - each file has a unique presence

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <mail@timgolden.me.uk>
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; 'subject:file': 0.07; 'accepts': 0.09; 'python': 0.11; 'python.': 0.11; 'backslashes': 0.16; 'from:addr:timgolden.me.uk': 0.16; 'from:name:tim golden': 0.16; 'message-id:@timgolden.me.uk': 0.16; 'received:74.55.86': 0.16; 'received:74.55.86.74': 0.16; 'received:smtp.webfaction.com': 0.16; 'received:webfaction.com': 0.16; 'slashes': 0.16; 'subject: \n ': 0.16; 'subject:folder': 0.16; 'subject:sub': 0.16; 'tjg': 0.16; 'wrote:': 0.16; 'passes': 0.18; 'windows': 0.20; 'needed.': 0.23; 'passing': 0.23; "i've": 0.24; 'import': 0.24; 'header:In-Reply-To:1': 0.24; 'header:User- Agent:1': 0.26; 'this.': 0.28; 'subject:/': 0.29; '(although': 0.29; 'cases.': 0.29; 'them?': 0.29; 'unchanged': 0.29; 'convert': 0.29; 'function': 0.30; 'call,': 0.33; "d'aprano": 0.33; 'received:192.168.100': 0.33; 'steven': 0.33; 'to:addr:python- list': 0.35; 'along': 0.35; 'path': 0.35; 'but': 0.36; 'heard': 0.36; 'modules': 0.36; 'subject:: ': 0.37; 'does': 0.39; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'subject:-': 0.39; 'forward': 0.65; 'from:addr:mail': 0.70; 'special': 0.72; 'edwards': 0.91
Date Thu, 21 May 2015 15:32:49 +0100
From Tim Golden <mail@timgolden.me.uk>
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.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> <mjkp7j$p7k$1@reader1.panix.com>
In-Reply-To <mjkp7j$p7k$1@reader1.panix.com>
Content-Type text/plain; charset=ISO-8859-1
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 <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.201.1432218774.17265.python-list@python.org> (permalink)
Lines 24
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1432218774 news.xs4all.nl 2840 [2001:888:2000:d::a6]:40275
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:91011

Show key headers only | View raw


On 21/05/2015 15:14, Grant Edwards wrote:
> On 2015-05-21, Steven D'Aprano <steve+comp.lang.python@pearwood.info> wrote:
> 
>> import glob
>> print(glob.glob("c:/abc/def/ghjmain/features/XYZ/*<filename>"))
>>
>> 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?
> 

It doesn't: Python passes them on unchanged and Windows accepts them in
all but a few cases.

(Although if any stdlib function were to call, eg, os.path.abspath on a
path before passing it along to Windows then one effect is that the path
is "normalised", ending up with backslashes. So perhaps that does happen
in modules like shutil. Not sure).


TJG

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


Thread

Find if a file existing within 1000s of folder/sub-folder - each file has a unique presence chaotic.sid@gmail.com - 2015-05-20 22:34 -0700
  Re: Find if a file existing within 1000s of folder/sub-folder - each file has a unique presence Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-05-21 18:07 +1000
    Re: Find if a file existing within 1000s of folder/sub-folder - each file has a unique presence Peter Otten <__peter__@web.de> - 2015-05-21 10:54 +0200
    Re: Find if a file existing within 1000s of folder/sub-folder - each file has a unique presence Tim Golden <mail@timgolden.me.uk> - 2015-05-21 10:06 +0100
    Re: Find if a file existing within 1000s of folder/sub-folder - each file has a unique presence Grant Edwards <invalid@invalid.invalid> - 2015-05-21 14:14 +0000
      Re: Find if a file existing within 1000s of folder/sub-folder - each file has a unique presence Chris Angelico <rosuav@gmail.com> - 2015-05-22 00:27 +1000
        Re: Find if a file existing within 1000s of folder/sub-folder - each file has a unique presence Grant Edwards <invalid@invalid.invalid> - 2015-05-21 16:31 +0000
          Re: Find if a file existing within 1000s of folder/sub-folder - each file has a unique presence MRAB <python@mrabarnett.plus.com> - 2015-05-21 17:54 +0100
      Re: Find if a file existing within 1000s of folder/sub-folder - each file has a unique presence Tim Golden <mail@timgolden.me.uk> - 2015-05-21 15:32 +0100

csiph-web