Path: csiph.com!x330-a1.tempe.blueboxinc.net!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.095 X-Spam-Evidence: '*H*': 0.81; '*S*': 0.00; 'files:': 0.09; 'image- size:2**10': 0.09; 'match.': 0.09; 'subject:None': 0.09; '(0)': 0.11; 'monitor': 0.12; 'def': 0.13; 'dirs,': 0.16; 'indirect': 0.16; 'licence.': 0.16; 'middlesex': 0.16; 'reproduce,': 0.16; 'root,': 0.16; 'sky': 0.16; 'subject:Query': 0.16; 'to:name :python-list@python.org': 0.16; 'wales': 0.16; 'subject:List': 0.20; 'skip:& 30': 0.25; 'england': 0.26; "doesn't": 0.28; 'thanks': 0.29; 'external': 0.29; 'hi,': 0.29; 'subject:?': 0.29; 'xmlns=""': 0.29; 'list': 0.30; 'lot,': 0.31; 'marco': 0.31; 'networks.': 0.31; 'paragraph': 0.31; "can't": 0.31; 'to:addr :python-list': 0.32; 'skip:& 20': 0.33; 'skip:" 10': 0.34; 'regular': 0.34; 'there': 0.35; 'file': 0.35; 'received:10.9': 0.35; 'received:bigfish.com': 0.35; 'doing': 0.36; 'charset:us- ascii': 0.36; 'filename:fname piece:image001': 0.37; 'system.': 0.37; 'url:rec-html40': 0.37; 'registered': 0.37; 'case': 0.37; 'should': 0.37; 'but': 0.38; '+44': 0.38; 'no.': 0.38; 'skip:" 20': 0.38; 'files': 0.38; 'delete': 0.38; 'url:org': 0.38; 'used': 0.38; 'under': 0.39; 'to:addr:python.org': 0.39; 'views': 0.40; 'direct': 0.61; 'content-type:multipart/related': 0.61; 'virus:src="cid:': 0.62; 'full': 0.62; 'our': 0.63; 'anyone.': 0.64; 'filename:fname piece:jpg': 0.65; 'companies': 0.66; 'content-type:image/jpeg': 0.66; 'share': 0.67; 'disclose': 0.68; 'incorporated': 0.68; 'store,': 0.68; 'policy,': 0.73; 'british': 0.77; 'broadcasting': 0.84; 'received:10.9.14.247': 0.84; 'retransmit,': 0.84; 'smooth': 0.84; 'subject:Case': 0.84; 'addressee.': 0.97 X-SpamScore: -4 X-BigFish: VPS-4(zz179aMzz1202hzz8275bh8275dhd311fiz2dh54h2a8h668h61h) X-Spam-TCS-SCL: 0:0 X-Forefront-Antispam-Report: KIP:(null); UIP:(null); IPVD:NLI; H:CHIXEDG01.BSKYB.COM; RD:ip-80-238-1-152.bskyb.com; EFVD:NLI From: "Wehe, Marco" To: "python-list@python.org" Subject: In List Query -> None Case Sensitive? Thread-Topic: In List Query -> None Case Sensitive? Thread-Index: Acvv6Ki5xXglY7ueQiKeste2isDvuA== Date: Thu, 31 Mar 2011 21:14:45 +0000 Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [10.64.21.63] Content-Type: multipart/related; boundary="_004_BB7D4CEE02C38D499DF7CA5B8D08578721DDDF7EAMSXMBX01bskybc_"; type="multipart/alternative" MIME-Version: 1.0 X-OriginatorOrg: bskyb.com X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 508 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1301607001 news.xs4all.nl 34849 [::ffff:82.94.164.166]:35283 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:2302 --_004_BB7D4CEE02C38D499DF7CA5B8D08578721DDDF7EAMSXMBX01bskybc_ Content-Type: multipart/alternative; boundary="_000_BB7D4CEE02C38D499DF7CA5B8D08578721DDDF7EAMSXMBX01bskybc_" --_000_BB7D4CEE02C38D499DF7CA5B8D08578721DDDF7EAMSXMBX01bskybc_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, I am doing a search through a list of files but the text the casing doesn't= match. My list is all upper case but the real files are all different. Is = there a smooth way of searching through the list without going full on regu= lar expressions? path =3D "V:\\Jinsy\\incoming\\assets" media=3D["LIHOU ISLAND.MOV", "MVI_1449.MOV"] def FindMedia(path): result =3D [] for root, dirs, files in os.walk(path): for iFile in files: if iFile in media: filePath =3D os= .path.join(root, iFile) result.append(f= ilePath) return result for filePath in FindMedia(path): log(filePath) This is the real file name that I can't find: Lihou Island.mov Thanks a lot, Marco [sky] Marco Wehe Visual Effects TD VFX/3D BSkyB, Sky 2, Grant Way, Isleworth, Middlesex TW7 5QD t: +44 (0) 20 7805 8035 f: +44 (0) 20 7805 6577 e: marco.wehe@bskyb.com Information in this email including any attachments may be privileged, conf= idential and is intended exclusively for the addressee. The views expressed= may not be official policy, but the personal views of the originator. If y= ou have received it in error, please notify the sender by return e-mail and= delete it from your system. You should not reproduce, distribute, store, r= etransmit, use or disclose its contents to anyone. Please note we reserve t= he right to monitor all e-mail communication through our internal and exter= nal networks. SKY and the SKY marks are trade marks of British Sky Broadcas= ting Group plc and are used under licence. British Sky Broadcasting Limited= (Registration No. 2906991), Sky Interactive Limited (Registration No. 3554= 332), Sky-In-Home Service Limited (Registration No. 2067075) and Sky Subscr= ibers Services Limited (Registration No. 2340150) are direct or indirect su= bsidiaries of British Sky Broadcasting Group plc (Registration No. 2247735)= . All of the companies mentioned in this paragraph are incorporated in Engl= and and Wales and share the same registered office at Grant Way, Isleworth,= Middlesex TW7 5QD. --_000_BB7D4CEE02C38D499DF7CA5B8D08578721DDDF7EAMSXMBX01bskybc_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi,

 

I am doing a search through a list of files but the text= the casing doesn't match. My list is all upper case but the real files are= all different. Is there a smooth way of searching through the list without going full on regular exp= ressions?

 

path =3D "V:\\Jinsy\\incoming\\assets"

 <= /o:p>

media=3D["LIHOU ISLAND.MOV", "MVI_1449.MOV"]

 <= /o:p>

def FindMedia(path):

=

         =    result =3D []<= /p>

         =   

         =    for root, dirs, files in os.walk(path):

         =          =       for iFile in files:

         =          =        = ;          

         =          =        = ;           if iFile = in media:

         =          =        = ;                 =        = ;           filePath = =3D os.path.join(root, iFile)

         =          =        = ;                 =        = ;           result.append(filePath)

         =          =        = ;                 =      

         =    return result<= /p>

         =   

 <= /o:p>

for filePath in FindMedia<= /span>(path):

         =    log(filePath)

 

 

 

This is the real file name that I can't find:=

Lihou Island.mov

 

Thanks a lot,

Marco=

3D"sky"

Marco Wehe

Visual Effects TD
VFX/3D
BSkyB, Sky 2, Grant Way, Isleworth, Middlesex TW7 5QD
=

t:<= font size=3D"1" face=3D"Verdana"> +44 (0) 20 7805 8035
f:
+44 (0) 20 7805 6577
e: marco.wehe@bskyb.c= om

 


=0D Information in this email including any attachments may be privileged, conf= idential and is intended exclusively for the addressee. The views expressed= may not be official policy, but the personal views of the originator. If y= ou have received it in error, please notify the sender by return e-mail and= delete it from your system. You should not reproduce, distribute, store, r= etransmit, use or disclose its contents to anyone. Please note we reserve t= he right to monitor all e-mail communication through our internal and exter= nal networks. SKY and the SKY marks are trade marks of British Sky Broadcas= ting Group plc and are used under licence. British Sky Broadcasting Limited= (Registration No. 2906991), Sky Interactive Limited (Registration No. 3554= 332), Sky-In-Home Service Limited (Registration No. 2067075) and Sky Subscr= ibers Services Limited (Registration No. 2340150) are direct or indirect su= bsidiaries of British Sky Broadcasting Group plc (Registration No. 2247735)= . All of the companies mentioned in this paragraph are incorporated in Engl= and and Wales and share the same registered office at Grant Way, Isleworth,= Middlesex TW7 5QD. --_000_BB7D4CEE02C38D499DF7CA5B8D08578721DDDF7EAMSXMBX01bskybc_-- --_004_BB7D4CEE02C38D499DF7CA5B8D08578721DDDF7EAMSXMBX01bskybc_ Content-Type: image/jpeg; name="image001.jpg" Content-Description: image001.jpg Content-Disposition: inline; filename="image001.jpg"; size=1181; creation-date="Thu, 31 Mar 2011 21:14:44 GMT"; modification-date="Thu, 31 Mar 2011 21:14:44 GMT" Content-ID: Content-Transfer-Encoding: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