My son wants me to teach him Python

Alister alister.ware at ntlworld.com
Fri Jun 14 11:35:21 EDT 2013


On Fri, 14 Jun 2013 05:41:20 -0500, Tim Chase wrote:

> 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 at 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

interestingly the 1st GUI program i wrote was designed to act as a plugin 
for Thunar, accept a list of photographs & copy then to a new directory 
with options to use exif data as part of the new name 



-- 
Christoph, please remember that irony is not available between the 
Canadian
and Mexican border.... you are confusing them again 8)

	- Alan Cox on linux-kernel



More information about the Python-list mailing list