Re: [Tutor] Iterating through a list of replacement regex patterns

2010-09-05 Thread David Hutto
On Sat, Sep 4, 2010 at 6:16 AM, Steven D'Aprano wrote: > On Sat, 4 Sep 2010 11:57:00 am David Hutto wrote: >> First of all, I'll respond more thoroughly tomorrow, when I can >> review what you said more clearly, but for now I'll clarify. >> >> Here is the whole code that I'm using: >> >> http://pa

Re: [Tutor] Iterating through a list of replacement regex patterns

2010-09-04 Thread Steven D'Aprano
On Sat, 4 Sep 2010 11:57:00 am David Hutto wrote: > First of all, I'll respond more thoroughly tomorrow, when I can > review what you said more clearly, but for now I'll clarify. > > Here is the whole code that I'm using: > > http://pastebin.com/Ak8DFjrb David, in genrandfiles() you say this:

Re: [Tutor] Iterating through a list of replacement regex patterns

2010-09-03 Thread David Hutto
snip I'll go further with this though, just to get the response. Hypothetically, if I wanted AI(artificial imagination), then I would want random thoughts that made sense, every once in a while. So, I hypothesize that the first step in Artificial Imagination, is random thoughts, and then they have

Re: [Tutor] Iterating through a list of replacement regex patterns

2010-09-03 Thread David Hutto
On Fri, Sep 3, 2010 at 9:57 PM, David Hutto wrote: > First of all, I'll respond more thoroughly tomorrow, when I can review > what you said more clearly, but for now I'll clarify. > > Here is the whole code that I'm using: > > http://pastebin.com/Ak8DFjrb > > On Fri, Sep 3, 2010 at 9:12 PM, Steven

Re: [Tutor] Iterating through a list of replacement regex patterns

2010-09-03 Thread David Hutto
First of all, I'll respond more thoroughly tomorrow, when I can review what you said more clearly, but for now I'll clarify. Here is the whole code that I'm using: http://pastebin.com/Ak8DFjrb On Fri, Sep 3, 2010 at 9:12 PM, Steven D'Aprano wrote: > On Fri, 3 Sep 2010 12:24:00 pm David Hutto wr

Re: [Tutor] Iterating through a list of replacement regex patterns

2010-09-03 Thread Steven D'Aprano
On Fri, 3 Sep 2010 12:24:00 pm David Hutto wrote: > In the below function I'm trying to iterate over the lines in a > textfile, and try to match with a regex pattern that iterates over > the lines in a dictionary(not {}, but turns a text list of > alphabetical words into a list using readlines()).

Re: [Tutor] Iterating through a list of replacement regex patterns

2010-09-03 Thread David Hutto
On Fri, Sep 3, 2010 at 2:51 PM, David Hutto wrote: > On Thu, Sep 2, 2010 at 11:05 PM, David Hutto wrote: >> I just added +'*' to select in re.search(select+'*', str(readfile[:])), >> and it now shows the same in both. >> >> But if you have any input on modifications let me know. >> >> Thanks, >>

Re: [Tutor] Iterating through a list of replacement regex patterns

2010-09-03 Thread David Hutto
On Thu, Sep 2, 2010 at 11:05 PM, David Hutto wrote: > I just added +'*' to select in re.search(select+'*', str(readfile[:])), > and it now shows the same in both. > > But if you have any input on modifications let me know. > > Thanks, > David > Still a problem. When I use the re.search(select+'*'

Re: [Tutor] Iterating through a list of replacement regex patterns

2010-09-02 Thread David Hutto
I just added +'*' to select in re.search(select+'*', str(readfile[:])), and it now shows the same in both. But if you have any input on modifications let me know. Thanks, David ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscriptio

[Tutor] Iterating through a list of replacement regex patterns

2010-09-02 Thread David Hutto
In the below function I'm trying to iterate over the lines in a textfile, and try to match with a regex pattern that iterates over the lines in a dictionary(not {}, but turns a text list of alphabetical words into a list using readlines()). def regexfiles(filename): textfile = file(filenam