Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.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.021 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'cc:addr:python-list': 0.10; 'python': 0.11; '18:13,': 0.16; 'files).': 0.16; 'from:addr:cs': 0.16; 'from:addr:zip.com.au': 0.16; 'from:name:cameron simpson': 0.16; 'message-id:@cskk.homeip.net': 0.16; 'received:211.29': 0.16; 'received:211.29.132': 0.16; 'received:cskk.homeip.net': 0.16; 'received:homeip.net': 0.16; 'received:optusnet.com.au': 0.16; 'received:syd.optusnet.com.au': 0.16; 'simpson': 0.16; 'wrote:': 0.16; 'byte': 0.18; '>>>': 0.20; 'cc:2**0': 0.21; 'cc:addr:python.org': 0.21; 'cc:no real name:2**0': 0.23; '2015': 0.23; 'cheers,': 0.24; 'header:In-Reply- To:1': 0.24; 'header:User-Agent:1': 0.26; 'cest': 0.29; 'once.': 0.29; 'way?': 0.29; "skip:' 10": 0.30; 'field,': 0.31; 'implement': 0.32; 'knows': 0.32; 'received:com.au': 0.33; 'file': 0.34; 'something': 0.35; 'but': 0.36; 'there': 0.36; 'subject:: ': 0.37; 'charset:us-ascii': 0.37; 'conference': 0.37; 'instead': 0.38; 'easily': 0.39; 'forget': 0.60; 'content- disposition:inline': 0.60; 'cameron': 0.66; 'thursday': 0.66; 'box,': 0.67; 'intelligent': 0.76; 'counts': 0.81; 'cecil': 0.84; 'points,': 0.84; 'schreef': 0.84; 'westerhof': 0.84 Date: Thu, 4 Jun 2015 15:43:39 +1000 From: Cameron Simpson To: Cecil Westerhof Cc: python-list@python.org Subject: Re: Find in ipython3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <87vbf4giu6.fsf@Equus.decebal.nl> User-Agent: Mutt/1.5.23 (2014-03-12) References: <87vbf4giu6.fsf@Equus.decebal.nl> X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=eZjABOwH c=1 sm=1 tr=0 a=rgDbx50tNA2z7xLXQOoruw==:117 a=rgDbx50tNA2z7xLXQOoruw==:17 a=ZtCCktOnAAAA:8 a=PO7r1zJSAAAA:8 a=J0QyKEt1u0cA:10 a=kj9zAlcOel0A:10 a=vrnE16BAAAAA:8 a=XAFQembCKUMA:10 a=rO0KX0Mmg2N9p48OPVgA:9 a=CjuIK1q_8ugA:10 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: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1433396629 news.xs4all.nl 2852 [2001:888:2000:d::a6]:41475 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:92032 On 04Jun2015 07:09, Cecil Westerhof wrote: >Op Thursday 4 Jun 2015 04:54 CEST schreef Cameron Simpson: > >> On 02Jun2015 18:13, Cecil Westerhof wrote: >>> I am thinking about using ipython3 instead of bash. When I want to >>> find a file I can do the following: >>> !find ~ -iname '*python*.pdf' >>> but is there a python way? >> >> That succinct? Not out of the box, but something can easily be built >> on top of the os.walk() function. > >OK, I will write it. And something to implement du. >Thanks. Have fun. For added points, do not forget that du knows about hardlinks and only counts a file once. And that it counts the blocks field, not the byte size (think: sparse files). Cheers, Cameron Simpson Thermochromic ink is the Pet Rock ink of the New Millennium. - overhead by WIRED at the Intelligent Printing conference Oct2006