[Tutor] regular expression matching a dot?

2005-10-19 Thread Christian Meesters
Hi I've got the problem that I need to find a certain group of file names within a lot of different file names. Those I want to match with a regular expression are a bit peculiar since they all look like: 07SS.INF , 10SE.INF, 13SS.INF, 02BS.INF, 05SS.INF. Unfortunately there are similar file nam

Re: [Tutor] regular expression matching a dot?

2005-10-19 Thread Kent Johnson
Christian Meesters wrote: > Hi > > I've got the problem that I need to find a certain group of file names > within a lot of different file names. Those I want to match with a > regular expression are a bit peculiar since they all look like: > 07SS.INF , 10SE.INF, 13SS.INF, 02BS.INF, 05SS.INF. >

Re: [Tutor] regular expression matching a dot?

2005-10-19 Thread Misto .
[ Workaround ] What about using the glob module? http://docs.python.org/lib/module-glob.html you can use something like glob.glob('./[0-9][0-9]S[E|S].INF') (Not tested) Misto ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listi

Re: [Tutor] regular expression matching a dot?

2005-10-19 Thread Christian Meesters
Hi Misto, Thanks, but this is no option for me - though I use glob a lot in other cases (mostly the quick and dirty hacks). But here I'm working on a list of names - not the files directly. Besides: REs are a lot more powerful (usually ;-), e.g. I'm using \d+ since I don't now that there are a

Re: [Tutor] regular expression matching a dot?

2005-10-19 Thread Christian Meesters
Actually, your answer did help to open my eyes. The expression is "\d+S[S|E]\.INF": Ouch! Thanks a lot, Christian On 19 Oct 2005, at 12:11, Misto . wrote: > [ Workaround ] > What about using the glob module? > > http://docs.python.org/lib/module-glob.html > > you can use something like > glob.g

Re: [Tutor] regular expression matching a dot?

2005-10-19 Thread Kent Johnson
Christian Meesters wrote: > Actually, your answer did help to open my eyes. The expression is > "\d+S[S|E]\.INF": Ouch! That will work, but what you really mean is one of these: "\d+S[SE]\.INF" "\d+S(S|E)\.INF" Your regex will match 0S|.INF Kent ___

[Tutor] setting

2005-10-19 Thread Shi Mu
I have installed Python 2.3 and I type "help()" and then "Keywords". I get a list of words. And it says that I can enter any of the words to get more help. I enter "and" and I get the following error message: "Sorry, topic and keyword documentation is not available because the Python HTML document

Re: [Tutor] regular expression matching a dot?

2005-10-19 Thread Christian Meesters
Thanks, corrected. I was happy now - and then too fast ;-). Cheers Christian On 19 Oct 2005, at 13:50, Kent Johnson wrote: > Christian Meesters wrote: >> Actually, your answer did help to open my eyes. The expression is >> "\d+S[S|E]\.INF": Ouch! > > That will work, but what you really mean is o

[Tutor] python books

2005-10-19 Thread David Holland
The best book I found was python programming for the absolute beginner by Michael Dawson. I would strongly recommend it. The only annoying thing is that he uses a games wrapper called livewires, which he modifies from the original but keeps the same name, which does not seem very clever to me. So

[Tutor] python books

2005-10-19 Thread David Holland
The best book I found was python programming for the absolute beginner by Michael Dawson. I would strongly recommend it. The only annoying thing is that he uses a games wrapper called livewires, which he modifies from the original but keeps the same name, which does not seem very clever to me. So

Re: [Tutor] setting

2005-10-19 Thread paul brian
Did you install from the python.org download or from activestate. If you have a .chm file I am guessing activestate. For some reason the normal docs that you get with the python.org distributin (the "official" one) are only found as a chm file. I suggest you get the python.org installer and carefu

[Tutor] define vars by iteration

2005-10-19 Thread Luke Jordan
I've got a bunch of pickled class instances with self.name attributes, and I would like to assign the instances themselves to variables named whatever is stored in self.name using a function. "Can't assign to literal", right? Is there a way to do this?   Thanks,   Luke

Re: [Tutor] setting

2005-10-19 Thread Brian van den Broek
Shi Mu said unto the world upon 2005-10-19 07:22: > I have installed Python 2.3 and I type "help()" and then "Keywords". > I get a list of words. And it says that I can enter any of the words > to get more help. I enter > "and" and I get the following error message: > "Sorry, topic and keyword doc

Re: [Tutor] define vars by iteration

2005-10-19 Thread Danny Yoo
On Wed, 19 Oct 2005, Luke Jordan wrote: > I've got a bunch of pickled class instances with > self.nameattributes, and I would like to assign the > instances themselves to variables > named whatever is stored in self.name using a function. > "Can't assign to

[Tutor] Saving command line keyed input?

2005-10-19 Thread CPIM Ronin
I know that one should use IDLE or a choosen editor for any substantial Python coding! However, if one happens to have written some interesting doodlings on the regular command line interface (under Windows XP in my case), is there an easy way to save ALL input to date into a selected file? Fo

Re: [Tutor] Saving command line keyed input?

2005-10-19 Thread bob
At 02:12 PM 10/19/2005, CPIM Ronin wrote: >I know that one should use IDLE or a choosen editor for any substantial >Python coding! However, if one happens to have written some interesting >doodlings on the regular command line interface (under Windows XP in my >case), is there an easy way to save

[Tutor] iteration is overwriting the previous set value

2005-10-19 Thread Jonas Melian
def _pre_save(self): for field in [self.name, self.native_name]: if not field.istitle(): #print field.title() field = field.title() The change I try to do there (field = field.title()) is not being applied I changed code so that you do 'self.foo = bar' statement

Re: [Tutor] iteration is overwriting the previous set value

2005-10-19 Thread Danny Yoo
On Thu, 20 Oct 2005, Jonas Melian wrote: > def _pre_save(self): > for field in [self.name, self.native_name]: > if not field.istitle(): > #print field.title() > field = field.title() > > The change I try to do there (field = field.title()) is not being > applie

Re: [Tutor] iteration is overwriting the previous set value

2005-10-19 Thread bob
At 04:16 PM 10/19/2005, Jonas Melian wrote: >def _pre_save(self): > for field in [self.name, self.native_name]: > if not field.istitle(): > #print field.title() > field = field.title() > >The change I try to do there (field = field.title()) is not being applied

Re: [Tutor] iteration is overwriting the previous set value

2005-10-19 Thread bob
At 04:16 PM 10/19/2005, Jonas Melian wrote: >def _pre_save(self): > for field in [self.name, self.native_name]: > if not field.istitle(): > #print field.title() > field = field.title() And FWIW there is no benefit in using "if not field.istitle():" since it cal

Re: [Tutor] Python books: buying advice needed

2005-10-19 Thread Byron
Hi David, The answer depends. If you are looking for free resources, I would recommend checking out: http://www.greenteapress.com However, if you are looking for a professional-grade book, then I would recommend "Python Programming for the Absolute Beginner." I, personally speaking, found t

Re: [Tutor] python books

2005-10-19 Thread Byron
David Holland wrote: > The best book I found was python programming for the > absolute beginner by Michael Dawson. I would strongly > recommend it. Yes, I would agree 100%. Michael Dawson does an excellent job teaching Python to beginners. (Most others don't come close to his book, in my opi

Re: [Tutor] Python books: buying advice needed

2005-10-19 Thread w chun
On 10/18/05, Kent Johnson <[EMAIL PROTECTED]> wrote: > David Stotijn wrote: > > Hi, > > > > I'm planning on buying a book to help me learn Python. Some of the books > > I'm considering are a few years old and based on an older version of > > Python (e.g. 2.3). > > Is it wise to buy a book based on

Re: [Tutor] Saving command line keyed input?

2005-10-19 Thread w chun
On 10/19/05, bob <[EMAIL PROTECTED]> wrote: > At 02:12 PM 10/19/2005, CPIM Ronin wrote: > >I know that one should use IDLE or a choosen editor for any substantial > >Python coding! However, if one happens to have written some interesting > >doodlings on the regular command line interface (under Wi