Very dumb question

David Stockwell winexpert at hotmail.com
Wed Oct 12 10:48:50 EDT 2005


Indeed,    Are you writing a new book?

http://www.amazon.com/exec/obidos/ASIN/1563052857/wildwierdmathpro


David
-------
Surf a wave to the future with a free tracfone 
http://cellphone.duneram.com/index.html




>From: Laszlo Zsolt Nagy <gandalf at designaproduct.biz>
>To: python-list at python.org
>Subject: Very dumb question
>Date: Wed, 12 Oct 2005 15:39:29 +0200
>I have a program with this code fragment:
>
>     print len(data)
>     print data[:50]
>     raise SystemExit
>
>This prints:
>
>20381
><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
>
>But if I change 50 to 51
>
>     print len(data)
>     print data[:51]
>     raise SystemExit
>
>then it prints
>
>20381
>  !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
>
>After all, only the last 50 bytes are printed. The string is the same
>(length 20381) in both cases.
>Surprisingly, I can print more than 50 characters, this works:
>
>print "012345678901234567890123456789012345678901234567890123456789A"
>
>I'm sure it is my mistake, but I don't know what am I doing wrong. Do
>you have an idea?
>Thanks,
>
>    Les
>
>--
>http://mail.python.org/mailman/listinfo/python-list





More information about the Python-list mailing list