Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #48112
| Date | 2013-06-14 05:41 -0500 |
|---|---|
| From | Tim Chase <python.list@tim.thechases.com> |
| Subject | Re: My son wants me to teach him Python |
| 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> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.3291.1371206377.3114.python-list@python.org> (permalink) |
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 | Next — Previous in thread | Next in thread | Find similar | Unroll 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