possibly OT - delete char?

Richie Hindle richie at entrian.com
Mon Sep 16 12:33:27 EDT 2002


> - is there a character which deletes the previous printed character when
> printed?

Yes, \b, in a reasonably portable manner:

$ uname -sr
Linux 2.4.7-10smp
$ python
Python 2.1.3 (#1, May 15 2002, 14:56:49) 
[GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-98)] on linux2
Type "copyright", "credits" or "license" for more information.
>>> print "12\b3"
13
>>> 

C:\>ver

Microsoft Windows XP [Version 5.1.2600]

C:\>python
Python 1.5.2 (#0, Feb  4 2002, 16:19:07) [MSC 32 bit (Intel)] on win32
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> print "12\b3"
13
>>>

-- 
Richie Hindle
richie at entrian.com



More information about the Python-list mailing list