[Tutor] subprocess adds %0A to end of string

Kent Johnson kent37 at tds.net
Mon Dec 22 02:19:41 CET 2008


On Sun, Dec 21, 2008 at 7:29 PM, David <david at abbottdavid.com> wrote:
> This seems to work;
>
> download = L.readline()
> print download
> download = download[0:-1]
>
> What is that last character that is added;
> .mp3%0A

It is a newline character (line feed). readline() includes the line
endings in the returned lines. Try
download = L.readline().rstrip()

Kent


More information about the Tutor mailing list