displaying \n-less prompts in a pythonic way

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Thu Oct 26 09:01:14 EDT 2006


Sybren Stuvel:
> def prompt(label):
>     '''Prompts the user, returning the typed text'''

>     sys.stdout.write(label)
>     return sys.stdin.readline()

Maybe raw_input function may help too.

Bye,
bearophile




More information about the Python-list mailing list