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


Groups > comp.lang.python > #48112

Re: My son wants me to teach him Python

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python.list@tim.thechases.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.006
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'subject:Python': 0.06; 'modify': 0.07; 'string': 0.09; 'extracted': 0.09; 'filename': 0.09; 'non-text': 0.09; 'similar,': 0.09; 'cc:addr:python-list': 0.11; 'command-line': 0.16; 'files)': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'renaming': 0.16; 'replaced.': 0.16; 'subject:son': 0.16; 'transforming': 0.16; 'files.': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'directory.': 0.24; 'replace': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; "i've": 0.25; 'least': 0.26; 'certain': 0.27; 'header:In-Reply- To:1': 0.27; 'idea': 0.28; 'fixed': 0.29; 'chris': 0.29; 'sets': 0.30; 'along': 0.30; 'container': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'file': 0.32; 'another': 0.32; 'text': 0.33; 'fri,': 0.33; 'but': 0.35; 'there': 0.35; '14,': 0.36; 'data,': 0.36; 'done': 0.36; 'charset:us-ascii': 0.36; 'operating': 0.37; 'sometimes': 0.38; 'files': 0.38; 'pm,': 0.38; 'extremely': 0.39; 'moving': 0.39; 'challenge': 0.61; 'information': 0.63; 'name': 0.63; 'to:addr:gmail.com': 0.65; 'media': 0.66; 'containing': 0.69; 'subject:wants': 0.74; 'you:': 0.81; 'birthday': 0.84; 'received:50.22': 0.84; '2013': 0.98
Date Fri, 14 Jun 2013 05:41:20 -0500
From Tim Chase <python.list@tim.thechases.com>
To Chris Angelico <rosuav@gmail.com>
Subject Re: My son wants me to teach him Python
In-Reply-To <CAPTjJmpdxRrpCKhhdj4cz7+A2QyBVeMAibZn9E3RUEh+eoNunw@mail.gmail.com>
References <Pine.LNX.4.64.1306131844240.11512@tau.ceti.pl> <mailman.3219.1371154780.3114.python-list@python.org> <637daa98-9a0e-46ab-bb9a-f5638b7c0038@googlegroups.com> <51bab49a$0$29997$c3e8da3$5496439d@news.astraweb.com> <CAPTjJmpdxRrpCKhhdj4cz7+A2QyBVeMAibZn9E3RUEh+eoNunw@mail.gmail.com>
X-Mailer Claws Mail 3.7.6 (GTK+ 2.20.1; x86_64-pc-linux-gnu)
Mime-Version 1.0
Content-Type text/plain; charset=US-ASCII
Content-Transfer-Encoding 7bit
X-AntiAbuse This header was added to track abuse, please include it with any abuse report
X-AntiAbuse Primary Hostname - boston.accountservergroup.com
X-AntiAbuse Original Domain - python.org
X-AntiAbuse Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse Sender Address Domain - tim.thechases.com
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
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.3291.1371206377.3114.python-list@python.org> (permalink)
Lines 30
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1371206377 news.xs4all.nl 15986 [2001:888:2000:d::a6]:39979
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:48112

Show key headers only | View raw


On 2013-06-14 17:21, Chris Angelico wrote:
> On Fri, Jun 14, 2013 at 4:13 PM, Steven D'Aprano
> <steve+comp.lang.python@pearwood.info> wrote:
> > Here's another Pepsi Challenge for you:
> >
> > There is a certain directory on your system containing 50 text
> > files, and 50 non-text files. You know the location of the
> > directory. You want to locate all the text files in this
> > directory containing the word "halibut", then replace the word
> > "halibut" with "trout", but only if the file name begins with a
> > vowel.
> 
> That sounds extremely contrived, to be honest.

I've actually done similar, moving sets of media files while renaming
& transforming them (id3v2 to set mp3 tags or modify
filenames/target-directories; exif/convert for .jpg files) along the
way and selecting them, along with container files (select playlists
for MP3s).  Sometimes the media files are named poorly, but better
filename information can be extracted from internal metadata, or can
be combined into things like photo-sets (rather than "DSC314159.JPG",
I can at least have "2013-04-01 Mom's birthday party 314159.jpg"
where the date comes from EXIF data, and a fixed string is replaced.

The idea of operating in batch on any data is pretty much always a
command-line win.

-tim

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


Thread

Re: My son wants me to teach him Python Joshua Landau <joshua.landau.ws@gmail.com> - 2013-06-13 21:18 +0100
  Re: My son wants me to teach him Python Rick Johnson <rantingrickjohnson@gmail.com> - 2013-06-13 20:33 -0700
    Re: My son wants me to teach him Python Chris Angelico <rosuav@gmail.com> - 2013-06-14 14:02 +1000
      Re: My son wants me to teach him Python Anssi Saari <as@sci.fi> - 2013-06-14 15:02 +0300
        Re: My son wants me to teach him Python Chris Angelico <rosuav@gmail.com> - 2013-06-15 03:12 +1000
    Re: My son wants me to teach him Python Chris Angelico <rosuav@gmail.com> - 2013-06-14 14:05 +1000
      Re: My son wants me to teach him Python Rick Johnson <rantingrickjohnson@gmail.com> - 2013-06-16 12:04 -0700
        Re: My son wants me to teach him Python Chris Angelico <rosuav@gmail.com> - 2013-06-17 07:52 +1000
          Re: My son wants me to teach him Python Rick Johnson <rantingrickjohnson@gmail.com> - 2013-06-16 15:33 -0700
            Re: My son wants me to teach him Python Alister <alister.ware@ntlworld.com> - 2013-06-17 21:11 +0000
    Re: My son wants me to teach him Python Joshua Landau <joshua.landau.ws@gmail.com> - 2013-06-14 06:11 +0100
    Re: My son wants me to teach him Python Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-14 06:13 +0000
      Re: My son wants me to teach him Python Chris Angelico <rosuav@gmail.com> - 2013-06-14 17:21 +1000
      Re: My son wants me to teach him Python Tim Chase <python.list@tim.thechases.com> - 2013-06-14 05:41 -0500
        Re: My son wants me to teach him Python Alister <alister.ware@ntlworld.com> - 2013-06-14 15:35 +0000
      Re: My son wants me to teach him Python Neil Cerutti <neilc@norwich.edu> - 2013-06-14 16:01 +0000
        Re: My son wants me to teach him Python Chris Angelico <rosuav@gmail.com> - 2013-06-15 03:14 +1000
      Re: My son wants me to teach him Python Jason Swails <jason.swails@gmail.com> - 2013-06-14 13:03 -0400
    Re: My son wants me to teach him Python Jason Swails <jason.swails@gmail.com> - 2013-06-14 02:28 -0400
    Re: My son wants me to teach him Python Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-06-14 20:12 -0400

csiph-web