How to use readline interactively?

Adrian Eyre a.eyre at optichrome.com
Wed Oct 6 11:01:14 EDT 1999


> import sys
> while 1:
>     print "> ",
>     s = sys.stdin.readline()
>     if s[-1] == '\n': s = s[:-1]
>     if len(s) == 0: break
>     print "Hello " + s    

What about:

print "\rHello " + s

--------------------------------------------
Adrian Eyre <mailto:a.eyre at optichrome.com>
Optichrome Computer Solutions Ltd
Maybury Road, Woking, Surrey, GU21 5HX, UK
Tel: +44 1483 740 233  Fax: +44 1483 760 644
http://www.optichrome.com 
--------------------------------------------





More information about the Python-list mailing list