Re: [Tutor] list packing

2006-02-26 Thread Sean Perry
John Fouhy wrote: > On 27/02/06, kevin parks <[EMAIL PROTECTED]> wrote: > >>snd = [f for f in os.listdir('/Users/kevin/snd/') if f.endswith('.aif')] > > > If this is all you need, then you could do something like: > > snd = ['/Users/kevin/snd/%s' % f for f in > os.listdir('/Users/kevin/snd/') i

Re: [Tutor] list packing

2006-02-26 Thread John Fouhy
On 27/02/06, kevin parks <[EMAIL PROTECTED]> wrote: > snd = [f for f in os.listdir('/Users/kevin/snd/') if f.endswith('.aif')] If this is all you need, then you could do something like: snd = ['/Users/kevin/snd/%s' % f for f in os.listdir('/Users/kevin/snd/') if f.endswith('.aif')] Or, slightly

[Tutor] list packing

2006-02-26 Thread kevin parks
howdy, I am using the os module to do some of my heavy lifting for me. I am tried of building lists by hand so i decided that i would get python to look in a bunch of directories and stuff all the things it find there into a list depending on it's extension. Works great ... one problem sometime

Re: [Tutor] New Tutorial topic available

2006-02-26 Thread Mark Thomas
On 2/26/06, Alan Gauld <[EMAIL PROTECTED]> wrote: > I've just uploaded the latest tutorial topic covering inter-process > communications. It covers pipes and the use of fork(). > > Enjoy, as ever feedback is welcomed. Thanks Alan, your pages are a great source of information for us newbies. -- _

Re: [Tutor] Problem with threads

2006-02-26 Thread Kent Johnson
David Cohen wrote: > Hi, > > Here is the code attached. It is a simple test program that open a gtk > window and connect to a server (might be an irc or telnet server). > When the button "Connect" is clicked, the thread (should) starts and > read what is coming from the server. But it never happen

Re: [Tutor] Problem with threads

2006-02-26 Thread David Cohen
Hi, Here is the code attached. It is a simple test program that open a gtk window and connect to a server (might be an irc or telnet server). When the button "Connect" is clicked, the thread (should) starts and read what is coming from the server. But it never happens... just when I click on the "

[Tutor] New Tutorial topic available

2006-02-26 Thread Alan Gauld
I've just uploaded the latest tutorial topic covering inter-process communications. It covers pipes and the use of fork(). Enjoy, as ever feedback is welcomed. Alan G Author of the learn to program web tutor http://www.freenetpages.co.uk/hp/alan.gauld __

Re: [Tutor] software carpentry

2006-02-26 Thread Alan Gauld
> But the Software Carpentry Workshop was a revelation. It gives a great > deal of advice based on empirical studies on effective programming > practices. I´m partway through - it's a multiweek course. University > lecturer Greg Wilson offers thorough notes to accompany the .mp3 lectures, > all of

Re: [Tutor] Grepping a file for words in a list

2006-02-26 Thread Alan Gauld
"John Purser" <[EMAIL PROTECTED]> wrote in message > I'm writing a system admin script in python that checks recently > accessed files for keywords like "failed, denied, error,..." etc. I'm > using popen to call grep -F but it's VERY slow. Can > anyone suggest a faster method to do this? are

Re: [Tutor] Problem with threads

2006-02-26 Thread Kent Johnson
David Cohen wrote: > Hi all, > > I have a problem trying to use thread on python. > I import the threading module and execute this: > > def func_thread(): > something... > > new_thread = threading.Thread(target = func_thread) > new_thread.start() > > But the thread never really starts, just