simple string backspace question

John Machin sjmachin at lexicon.net
Tue Jul 31 15:00:31 CEST 2007


On Jul 31, 10:33 pm, Dustan <DustanGro... at gmail.com> wrote:
> On Jul 31, 7:17 am, John Machin <sjmac... at lexicon.net> wrote:
>
>
>
> > On Jul 31, 8:01 pm, vedrandeko... at v-programs.com wrote:
>
> > > On 31 srp, 11:44, vedrandeko... at v-programs.com wrote:
>
> > > > Hello,
>
> > > > I have one simple string, backspace character question.Here is my
> > > > example:
>
> > > > >>> text="Hello\bworld"
> > > > >>> print text
>
> > > > "HelloBSworld"
>
> > > > Should this character "\b" (backspace) in this text return this:
> > > > "Helloworld"?
>
> > > > Regards,
> > > > Vedran
>
> > > Hi,
>
> > > If you mean on operating system then unfortunately Windows XP.
>
> > Point (1) Works on Windows XP for me:
>
> > C:\junk>ver
>
> > Microsoft Windows XP [Version 5.1.2600]
>
> > C:\junk>\python25\python
> > Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit
> > (Intel)] on win32
> > Type "help", "copyright", "credits" or "license" for more information.
>
> > >>> text = "Hello\bworld"
> > >>> print text
> > Hellworld
>
> > or, for mild amusement:
>
> > >>> import sys, time
> > >>> for x in xrange(100):
>
> > ...     sys.stdout.write("|/-\\"[x & 3] + "\b")
> > ...     time.sleep(0.1)
> > ...
>
> Now try it on IDLE.

So the OP should have been slagging off at PythonWin and IDLE, not at
Windows.





More information about the Python-list mailing list