Is this a BUG?

Moshe Zadka moshez at zadka.site.co.il
Thu Dec 28 07:17:19 EST 2000


On Thu, 28 Dec 2000 10:48:14 +0100, QdlatY <qdlaty at wielun.dhs.org> wrote:

> print "!",form["index"].value,"!"
...prints...
> ! 1 !
> ----------------
>  ^ ^
> Why the hell there are spaces? index property has value '1'!
> not ' 1 '?!

Because print prints a space between its arguments.
The print statement is equivalent to 
``sys.stdout.write(" ".join("!", '1', "!")+'\n')'' 

Use sys.stdout.write for finer grain control, or

print "!%s!" % form['index']





More information about the Python-list mailing list