Re: Pattern matching from a text document

2005-03-24 Thread F. Petitjean
Le 24 Mar 2005 06:16:12 -0800, Ben a écrit : > > Below is a few sample lines. There is the name followed by the class > (not important) followed by 5 digits each of which can range 1-9 and > each detail a different ability, such as fitness, attacking ability > etc. Finally the preferred foot is st

Re: Pattern matching from a text document

2005-03-24 Thread Ben
George Sakkis wrote: > B > "Ben" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > I'm currently trying to develop a demonstrator in python for an > > ontology of a football team. At present all the fit players are > > exported to a text document. > > > > The program reads the docu

Re: Pattern matching from a text document

2005-03-24 Thread Larry Bates
Ben, Others have answered your specific questions, but I thought I'd use this opportunity to make a general statement. Unlike other programming languages, Python doesn't make its built-in functions keywords. You should never, ever, ever name a variable 'list' (the same is true of dict, tuple, st

Re: Pattern matching from a text document

2005-03-23 Thread infidel
First, if you're going to loop over each line, do it like this: for line in file('playerlist.txt'): #do stuff here Second, this statement is referencing the *second* item in the list, not the first: match = ph.match(list[1]) Third, a simple splitting of the lines by some delimiter character

Re: Pattern matching from a text document

2005-03-23 Thread George Sakkis
B "Ben" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm currently trying to develop a demonstrator in python for an > ontology of a football team. At present all the fit players are > exported to a text document. > > The program reads the document in and splits each line into a st

Pattern matching from a text document

2005-03-23 Thread Ben
I'm currently trying to develop a demonstrator in python for an ontology of a football team. At present all the fit players are exported to a text document. The program reads the document in and splits each line into a string (since each fit player and their attributes is entered line by line in t