[Tutor] really basic - finding multiline chunk within larger chunk

Joel Goldstick joel.goldstick at gmail.com
Tue Feb 16 11:14:58 EST 2016


On Tue, Feb 16, 2016 at 10:30 AM, bruce <badouglas at gmail.com> wrote:

> Hi.
>
> I've got a test, where I have a chunk of text "a" and a subset of text
> "s2a". the subset is multiline.
>
> For some reason, can't seem to return true on the find. I've pasted in
> http://fpaste.org/323521/, but the following is an example as well.
> (not sure if the psuedo code listed actually shows the chunks of text
> with the whitespace correctly.
>
> Obviously, this is an "example" not meant to be real code!!
>
> Thoughts on what I've screwed up?
>
> I have some thoughts!  First, the code you posted at the link doesn't
run.  Its usually a good thing to post example code if your real code is
large, and you can identify the problem.  Instead you post a long example
elsewhere that doesn't run.  So as to what was wrong, you had improper
indentation and some comments that weren't commented out.  When I fixed
those problems the code ran fine:

jcg at jcg:~$ python temp.py
here ppp 436


Its hard to tell what you want to do in the bigger picture, but this
probably isn't the right way to go.  Many people use BeautifulSoup to parse
html.   And where did you find that HTML?  Code like that should have died
19 years ago when CSS came on the seen.

> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>



-- 
Joel Goldstick
http://joelgoldstick.com/stats/birthdays


More information about the Tutor mailing list