Does Python mess with CRLFs?
John Machin
sjmachin at lexicon.net
Wed Nov 12 06:38:56 EST 2008
On Nov 12, 10:04 pm, Gilles Ganault <nos... at nospam.com> wrote:
> Hello
>
> I'm stuck at understanding why Python can't extract some bit from an
> HTML file using regexes, although I can find it just fine with
> UltraEdit.
>
> I wonder if Python rewrites CRLFs when reading a text file with
> open/read?
Don't wonder; do some very elementary debugging and find out for
yourself.
> Here's the code:
> ==========
> f = open("content.html", "r")
> content = f.read()
> f.close()
Consider inserting
print repr(content)
here.
More information about the Python-list
mailing list