Re: [Tutor] Newbie Wondering About Threads

2008-12-07 Thread Damon Timm
On Sun, Dec 7, 2008 at 9:35 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: > There is no need to include both the flac file name and the mp3 file > name if the roots match. You can use os.path functions to split the > extension or the quick-and-dirty way: > mp3file = flacfile.rsplit('.', 1)[0] + '.mp

Re: [Tutor] Newbie Wondering About Threads

2008-12-07 Thread Kent Johnson
On Sun, Dec 7, 2008 at 3:10 PM, Damon Timm <[EMAIL PROTECTED]> wrote: > I think I did it! Woo hoo! (cheers all around! drinks on me!) Cool! Where are we meeting for drinks? ;-) > flacFiles = [["test.flac","test.mp3"],["test2.flac","test2.mp3"],\ >["test3.flac","test3.mp3"],["test4.flac

Re: [Tutor] Newbie Wondering About Threads

2008-12-07 Thread Damon Timm
On Sun, Dec 7, 2008 at 10:47 AM, Kent Johnson <[EMAIL PROTECTED]> wrote: > A function as mentioned above would help. For the threaded solution > the function could just start the child process and wait for it to > finish, it doesn't have to return anything. Each thread will block on > its associate

Re: [Tutor] Newbie Wondering About Threads

2008-12-07 Thread Kent Johnson
On Sun, Dec 7, 2008 at 8:58 AM, Damon Timm <[EMAIL PROTECTED]> wrote: > On Sun, Dec 7, 2008 at 12:33 AM, Martin Walsh <[EMAIL PROTECTED]> wrote: >> Here is my simplistic, not-very-well-thought-out, attempt in >> pseudo-code, perhaps it will get you started ... >> >> paths = ["file1.flac","file2.fl

Re: [Tutor] Newbie Wondering About Threads

2008-12-07 Thread Damon Timm
On Sun, Dec 7, 2008 at 12:33 AM, Martin Walsh <[EMAIL PROTECTED]> wrote: > I'm not certain this completely explains the poor performance, if at > all, but the communicate method of Popen objects will wait until EOF is > reached and the process ends. So IIUC, in your example the process 'p' > runs t

Re: [Tutor] Newbie Wondering About Threads

2008-12-07 Thread Kent Johnson
On Sat, Dec 6, 2008 at 9:43 PM, Damon Timm <[EMAIL PROTECTED]> wrote: > The last piece of my puzzle though, I am having trouble wrapping my > head around ... I will have a list of files > ["file1.flac","file2.flac","file3.flac","etc"] and I want the program > to tackle compressing two at a time .

Re: [Tutor] Newbie Wondering About Threads

2008-12-06 Thread Lie Ryan
On Sat, 06 Dec 2008 21:43:11 -0500, Damon Timm wrote: > On Sat, Dec 6, 2008 at 6:25 PM, Python Nutter <[EMAIL PROTECTED]> > wrote: >> I'm on my phone so excuse the simple reply. From what I skimmed you are >> wrapping shell commands which is what I do all the time. Some hints. 1) >> look into pope

Re: [Tutor] Newbie Wondering About Threads

2008-12-06 Thread Martin Walsh
Damon Timm wrote: > On Sat, Dec 6, 2008 at 6:25 PM, Python Nutter <[EMAIL PROTECTED]> wrote: >> I'm on my phone so excuse the simple reply. >> From what I skimmed you are wrapping shell commands which is what I do >> all the time. Some hints. 1) look into popen or subprocess in place of >> execute

Re: [Tutor] Newbie Wondering About Threads

2008-12-06 Thread Damon Timm
On Sat, Dec 6, 2008 at 6:25 PM, Python Nutter <[EMAIL PROTECTED]> wrote: > I'm on my phone so excuse the simple reply. > From what I skimmed you are wrapping shell commands which is what I do > all the time. Some hints. 1) look into popen or subprocess in place of > execute for more flexibility. I

[Tutor] Newbie Wondering About Threads

2008-12-06 Thread Damon Timm
Hi Everyone - I am a complete and utter Python newbie (as of today, honestly) -- am interested in expanding my programming horizons beyond bash scripting and thought Python would be a nice match for me. To start, I thought I may try re-writing some of my bash scripts in Python as a learning tool f