Why is it different from the example on the tutorial?

rxjwg98 at gmail.com rxjwg98 at gmail.com
Sun Jul 6 11:03:48 EDT 2014


On Sunday, July 6, 2014 10:18:53 AM UTC-4, Rick Johnson wrote:
> On Sunday, July 6, 2014 8:38:41 AM UTC-5, rxj... at gmail.com wrote:
> 
> > When I get match result:
> 
> > py>pattern='abcd'
> 
> > py>prog = re.compile(pattern)
> 
> > py>string='abcd'
> 
> > py>result = prog.match(string)
> 
> > py>result
> 
> > <_sre.SRE_Match object at 0x6ffffeda5e0> 
> 
> > py>result.group(0)
> 
> > 'abcd'
> 
> > 
> 
> > It looks like 'result' is different from a simple
> 
> > 'counter' variable. I do not yet find the definition of
> 
> > 'result' object. What do you call 'result' object? Where
> 
> > can I find it (what topic would be in a tutorial)? Thanks,
> 
> 
> 
> One of the most powerful features of Python,,, for the
> 
> noob,,, be documentation strings. With Python you need not
> 
> buy expensive books, or venture into seedy and dangerous
> 
> alley ways of the inter-webs, no, all you need to do is do
> 
> that which any young and inexperienced lad would do when he
> 
> finds himself in a troubling situation:
> 
> 
> 
>     YELL FOR HELP!
> 
> 
> 
> The built-in function "help" will answer all your
> 
> questions,,, considering you ask the correct questions of
> 
> course!,,, but always remember the advice of a wise man and
> 
> don't become the "boy who cried wolf" one too many times!

Thanks. I do not want to waste everyone's time. For a jump start, there are
small errors making me frustrating. Your help does help me, confirm the usage
etc. After a basic familiarity, I do not want to post more. I use cygwin Python,
I type help of an object 'result'. It does show up the help content, but it
never quits the help afterwards. It is annoying, and time wasting. (Sorry again,
that problem may be about Cygwin, not Python. Excuse me to mention that here.
Of course, your help post consumes your time. Thanks again.



More information about the Python-list mailing list