On 15/06/2013 22:03, Joshua Landau wrote:
On 15 June 2013 11:18, Mark Lawrence wrote:
I tend to reach for string methods rather than an RE so will something like
this suit you?
c:\Users\Mark\MyPython>type a.py
for s in ("In the ocean",
"On the ocean",
"By the ocean",
On 15 June 2013 11:18, Mark Lawrence wrote:
> I tend to reach for string methods rather than an RE so will something like
> this suit you?
>
> c:\Users\Mark\MyPython>type a.py
> for s in ("In the ocean",
> "On the ocean",
> "By the ocean",
> "In this group",
>
Oops...
On Saturday, June 15, 2013 12:47:18 PM UTC-6, ru...@yahoo.com wrote:
> Links to the Python reference documentation are useful for people
> just beginning with some aspect of Python; they are for people who
> already know Python and want to look up details.
That was supposed to be:
Link
On 6/15/2013 12:28 PM, subhabangal...@gmail.com wrote:
Suppose I want a regular expression that matches both "Sent from my iPhone" and
"Sent from my iPod". How do I write such an expression--is the problem,
"Sent from my iPod"
"Sent from my iPhone"
which can be written as,
re.compile("Sent fro
etails. So it's no
>
> surprise that you did not find them useful.
>
>
>
> > I am looking for more intriguing exercises, esp use of or in
>
> > the pattern search.
>
>
>
> Have you tried searching on Google for "regular expression tutorial
ation are useful for people
just beginning with some aspect of Python; they are for people who
already know Python and want to look up details. So it's no
surprise that you did not find them useful.
> I am looking for more intriguing exercises, esp use of or in
> the pattern sear
> Regards,
>
> Subhabrata
Dear Group,
Thank you for the answer. But I want to learn bit of interesting regular
expression forms where may I? No Mark, thank you for your links but they were
not sufficient. I am looking for more intriguing exercises, esp use of or in
the pattern search.
Regards,
Subhabrata.
--
http://mail.python.org/mailman/listinfo/python-list
On 06/15/2013 03:42 AM, subhabangal...@gmail.com wrote:> Dear Group,
>
> I am trying to search the following pattern in Python.
>
> I have following strings:
>
> (i)"In the ocean"
> (ii)"On the ocean"
> (iii) "By the ocean"
> (iv) "In this group"
> (v) "In this group"
> (vi) "By the new gr
On 15/06/2013 17:28, subhabangal...@gmail.com wrote:
You've been pointed at several links, so what have you tried, and what,
if anything, went wrong? Or do you simply not understand, in which case
please say so and we'll help. I'm not trying to be awkward, it's simply
known that you learn mo
On Saturday, June 15, 2013 8:34:59 PM UTC+5:30, Mark Lawrence wrote:
> On 15/06/2013 15:31, subhabangal...@gmail.com wrote:
>
> >
>
> > Dear Group,
>
> >
>
> > I know this solution but I want to have Regular Expression option. Just
> > learning.
>
> >
>
> > Regards,
>
> > Subhabrata.
>
> >
On 15/06/2013 15:31, subhabangal...@gmail.com wrote:
Dear Group,
I know this solution but I want to have Regular Expression option. Just
learning.
Regards,
Subhabrata.
Start here http://docs.python.org/2/library/re.html
Would you also please read and action this,
http://wiki.python.org/m
subhabangal...@gmail.com wrote:
>I know this solution but I want to have Regular Expression option.
>Just learning.
http://mattgemmell.com/2008/12/08/what-have-you-tried/
Just spell out what you want:
A word at the beginning, followed by any text, followed by a word at
the end.
Now look up the ba
On Saturday, June 15, 2013 7:58:44 PM UTC+5:30, Mark Lawrence wrote:
> On 15/06/2013 14:45, Denis McMahon wrote:
>
> > On Sat, 15 Jun 2013 13:41:21 +, Denis McMahon wrote:
>
> >
>
> >> first_and_last = [sentence.split()[i] for i in (0, -1)] middle =
>
> >> sentence.split()[1:-2]
>
> >
>
>
On 15/06/2013 14:45, Denis McMahon wrote:
On Sat, 15 Jun 2013 13:41:21 +, Denis McMahon wrote:
first_and_last = [sentence.split()[i] for i in (0, -1)] middle =
sentence.split()[1:-2]
Bugger! That last is actually:
sentence.split()[1:-1]
It just looks like a two.
I've a very strong se
On Sat, 15 Jun 2013 13:41:21 +, Denis McMahon wrote:
> first_and_last = [sentence.split()[i] for i in (0, -1)] middle =
> sentence.split()[1:-2]
Bugger! That last is actually:
sentence.split()[1:-1]
It just looks like a two.
--
Denis McMahon, denismfmcma...@gmail.com
--
http://mail.pytho
On Sat, 15 Jun 2013 11:55:34 +0100, Mark Lawrence wrote:
> >>> sentence = "By the new group"
> >>> words = sentence.split()
> >>> words[words[0],words[-1]]
> Traceback (most recent call last):
>File "", line 1, in
> TypeError: list indices must be integers, not tuple
>
> So why would the
On Jun 15, 3:55 pm, Mark Lawrence wrote:
> On 15/06/2013 11:24, Denis McMahon wrote:
>
>
>
>
>
>
>
>
>
> > On Sat, 15 Jun 2013 10:05:01 +, Steven D'Aprano wrote:
>
> >> On Sat, 15 Jun 2013 02:42:55 -0700, subhabangalore wrote:
>
> >>> Dear Group,
>
> >>> I am trying to search the following pat
On 15/06/2013 11:24, Denis McMahon wrote:
On Sat, 15 Jun 2013 10:05:01 +, Steven D'Aprano wrote:
On Sat, 15 Jun 2013 02:42:55 -0700, subhabangalore wrote:
Dear Group,
I am trying to search the following pattern in Python.
I have following strings:
(i)"In the ocean" (ii)"On the ocean"
On Sat, 15 Jun 2013 10:05:01 +, Steven D'Aprano wrote:
> On Sat, 15 Jun 2013 02:42:55 -0700, subhabangalore wrote:
>
>> Dear Group,
>>
>> I am trying to search the following pattern in Python.
>>
>> I have following strings:
>>
>> (i)"In the ocean" (ii)"On the ocean" (iii) "By the ocean"
On 15/06/2013 10:42, subhabangal...@gmail.com wrote:
Dear Group,
I am trying to search the following pattern in Python.
I have following strings:
(i)"In the ocean"
(ii)"On the ocean"
(iii) "By the ocean"
(iv) "In this group"
(v) "In this group"
(vi) "By the new group"
.
On Sat, 15 Jun 2013 02:42:55 -0700, subhabangalore wrote:
> Dear Group,
>
> I am trying to search the following pattern in Python.
>
> I have following strings:
>
> (i)"In the ocean"
> (ii)"On the ocean"
> (iii) "By the ocean"
> (iv) "In this group"
> (v) "In this group"
> (vi) "By the ne
Dear Group,
I am trying to search the following pattern in Python.
I have following strings:
(i)"In the ocean"
(ii)"On the ocean"
(iii) "By the ocean"
(iv) "In this group"
(v) "In this group"
(vi) "By the new group"
.
I want to extract from the first word to the last word,
whe
Hi Paul,
Paul McGuire schrieb am 03/27/2007 07:19 PM:
> On Mar 27, 3:13 pm, Fabian Braennstroem <[EMAIL PROTECTED]> wrote:
>> Hi to all,
>>
>> Wojciech Mu?a schrieb am 03/27/2007 03:34 PM:
>>
>>> Fabian Braennstroem wrote:
Now, I would like to improve it by searching for different 'real'
Hi,
Gabriel Genellina schrieb am 03/27/2007 10:09 PM:
> En Tue, 27 Mar 2007 18:42:15 -0300, Diez B. Roggisch <[EMAIL PROTECTED]>
> escribió:
>
>> Paul McGuire schrieb:
>>> On Mar 27, 10:18 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
Fabian Braennstroem wrote:
> wh
En Tue, 27 Mar 2007 18:42:15 -0300, Diez B. Roggisch <[EMAIL PROTECTED]>
escribió:
> Paul McGuire schrieb:
>> On Mar 27, 10:18 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
>>> Fabian Braennstroem wrote:
while iter:
value = model.get_value(iter,
Paul McGuire schrieb:
> On Mar 27, 10:18 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
>> Fabian Braennstroem wrote:
>>> Hi,
>>> I wrote a small gtk file manager, which works pretty well. Until
>>> now, I am able to select different file (treeview entries) just by
>>> extension (done with 'ends
On Mar 27, 3:13 pm, Fabian Braennstroem <[EMAIL PROTECTED]> wrote:
> Hi to all,
>
> Wojciech Mu?a schrieb am 03/27/2007 03:34 PM:
>
> > Fabian Braennstroem wrote:
> >> Now, I would like to improve it by searching for different 'real'
> >> patterns just like using 'ls' in bash. E.g. the entry
> >> '
On Mar 27, 10:18 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> Fabian Braennstroem wrote:
> > Hi,
>
> > I wrote a small gtk file manager, which works pretty well. Until
> > now, I am able to select different file (treeview entries) just by
> > extension (done with 'endswith'). See the little
Hi to all,
Wojciech Mu?a schrieb am 03/27/2007 03:34 PM:
> Fabian Braennstroem wrote:
>> Now, I would like to improve it by searching for different 'real'
>> patterns just like using 'ls' in bash. E.g. the entry
>> 'car*.pdf' should select all pdf files with a beginning 'car'.
>> Does anyone have
Fabian Braennstroem wrote:
> Now, I would like to improve it by searching for different 'real'
> patterns just like using 'ls' in bash. E.g. the entry
> 'car*.pdf' should select all pdf files with a beginning 'car'.
> Does anyone have an idea, how to do it?
Use module glob.
--
http://mail.python.
Fabian Braennstroem wrote:
> Hi,
>
> I wrote a small gtk file manager, which works pretty well. Until
> now, I am able to select different file (treeview entries) just by
> extension (done with 'endswith'). See the little part below:
>
> self.pathlist1=[ ]
> self.
Hi,
I wrote a small gtk file manager, which works pretty well. Until
now, I am able to select different file (treeview entries) just by
extension (done with 'endswith'). See the little part below:
self.pathlist1=[ ]
self.patternlist=[ ]
while iter:
32 matches
Mail list logo