[Tutor] Comma at the end of a print command

Dragonfirebane at aol.com Dragonfirebane at aol.com
Sun Aug 15 01:04:26 CEST 2004


Hello all,

I know that when you put a comma at the end of a print command, the next 
printed object will be printed on the same line, separated by a space. Is there a 
way to do this without the space separation? i.e.:

def mod():
    import msvcrt
    model = msvcrt.getch()
    if model == '1':
        print model(*)
        model = msvcrt.getch() ##to get the next number
        print model

would output:

12

, printing the numbers one at a time, if '12' were inputed. as it is, the 
output is:

1 2

, which isn't what i want. So in other words: is there a way to provide 
'real-time' printing without the space separation?  The reason I'm using 
msvcrt.getch() is because if the number doesn't begin with a 1, then it must be below 
10, as the choices are from 2 to 15; which would make it easier (no need to hit 
enter) to process the choice.

* insert unknown symbol here

Email: dragonfirebane at aol.com
AIM: singingxduck
Programming Python for the fun of it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20040814/febb95c2/attachment.htm


More information about the Tutor mailing list