Re: [Tutor] reafline reads file, not just 1 line

2007-03-29 Thread Luke Paireepinart
Kirk Bailey wrote: > a relevant code snip: > > if os.path.exists('ConfigureMe'): > f1=open('ConfigureMe','r') > tablebgcolor=string.strip(f1.readline()) > papercolor=string.strip(f1.readline()) > inkcolor=string.strip(f1.readline()) > linkcolor=string.strip(f1.readline

[Tutor] [OT] ETL Tools

2007-03-29 Thread Stephen Nelson-Smith
Hello all, Does anyone know of any ETL (Extraction, Transformation, Loading) tools in Python (or at any rate, !Java)? I have lots (and lots) of raw data in the form of log files which I need to process and aggregate and then do a whole bunch of group-by operations, before dumping them into text/r

[Tutor] reafline reads file, not just 1 line

2007-03-29 Thread Kirk Bailey
a relevant code snip: if os.path.exists('ConfigureMe'): f1=open('ConfigureMe','r') tablebgcolor=string.strip(f1.readline()) papercolor=string.strip(f1.readline()) inkcolor=string.strip(f1.readline()) linkcolor=string.strip(f1.readline()) f1.close()

Re: [Tutor] Tutor Digest, Vol 37, Issue 72

2007-03-29 Thread Utkarsh Tandon
Is it possible to make daemons for *nix in Python ? How ? ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] getopts question

2007-03-29 Thread Greg Perry
Hello List Members, I am working on a simple program and would like to know the best way to approach this. Using getops I am parsing the argv array to grab command line options; from the command line the user can specify either a filename or a directory (but not both). Is there an eloquent wa

Re: [Tutor] or

2007-03-29 Thread John Fouhy
On 30/03/07, Christopher Spears <[EMAIL PROTECTED]> wrote: > What I can't remember is what is 'or' in python. For > example, what if I want the loop to skip apples and > pears? I tried this: > > >>> for f in fruit: > ... if f != "apples" or "pears": > ... print f > ...

[Tutor] or

2007-03-29 Thread Christopher Spears
I was doodling at the interpreter: >>> fruit = ["apples","pears","oranges"] >>> for f in fruit: ... if f != "apples": ... print f ... print "This is not an apple." ... pears This is not an apple. oranges This is not an apple. What I can't remember is what is 'or' in py

Re: [Tutor] A string-manipulation question

2007-03-29 Thread Alan Gilfoy
Awesome! (I was hoping it would be a 1-line solution. :) Thanks to batteries beign included, I don't necessarily need to worry about why and how .spilt() works. :) Quoting Bob Gailer <[EMAIL PROTECTED]>: > Alan Gilfoy wrote: >> Hi. I want to learn how to "break down" a string into its component

Re: [Tutor] A string-manipulation question

2007-03-29 Thread R. Alan Monroe
> Hi. I want to learn how to "break down" a string into its component > words, and then process each word somehow. > Is there a way in Python to separate a string into its component words. > Like this: > "I would like to convert an English string (sentence) into Pig Latin." for word in sentenc

Re: [Tutor] A string-manipulation question

2007-03-29 Thread Bob Gailer
Alan Gilfoy wrote: > Hi. I want to learn how to "break down" a string into its component > words, and then process each word somehow. > > Is there a way in Python to separate a string into its component words. > > Like this: > "I would like to convert an English string (sentence) into Pig Latin."

[Tutor] A string-manipulation question

2007-03-29 Thread Alan Gilfoy
Hi. I want to learn how to "break down" a string into its component words, and then process each word somehow. Is there a way in Python to separate a string into its component words. Like this: "I would like to convert an English string (sentence) into Pig Latin." The Pig Latin conversion I th