[Tutor] Reading from a GUI

wheelege wheelege@tsn.cc
Mon, 22 Jan 2001 11:58:16 +1100


  Hi,

  Is this what you meant....

PythonWin 2.0 (#8, Oct 19 2000, 11:30:05) [MSC 32 bit (Intel)] on win32.
Portions Copyright 1994-2000 Mark Hammond (MarkH@ActiveState.com) - see
'Help/About PythonWin' for further copyright information.
>>> a = "first line\nsecond line"
>>> a
'first line\012second line'
>>> print a
first line
second line

  From that I gather that the escape code is \012 ?

  HTH,
  Glen.

----- Original Message -----
From: Budgester <budgester@budgester.com>
To: Tutor (E-mail) <tutor@python.org>
Sent: Monday, January 22, 2001 10:45 AM
Subject: [Tutor] Reading from a GUI


> Hi all,
>
> I have posted to script to Rob,
> http://www.lowerstandard.com/python/pythonsource.html
> (Martin Stevens, TKinter thingy)
>
>
> What I'd like to do now is read the text string that is retrieved from
> the text box and find the line breaks/carriage returns.
>
> Should I use readlines ?
>
> This is eventually gonna be a html diary updater so what I want to be able
> to
> do is replace the line break from the text box with a <BR>.
>
> Shouldn't be to difficult but I need to find the escape code for the line
> break.
>
> Any ideas would help
>
> Budgester
>
>
> mailto:budgester@budgester.com
> http://www.budgester.com
>
>
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor