How to get rid of the space after 'print',?

Charles Cazabon c_cazabon at
Thu Feb 10 19:16:11 EST 2000

Peter Bittner claimed in <38A34DFE.7B286DD at>:

>  print '<table border=0><tr>'
>  print '<td><b>Author:</b></td><td>',   # ,= no newline here
>  print '<input ...>'         # or put a function call here...
>Between <td> and <input> I want _no_ space, but Python automatically
>inserts one. - How can I force Python not to do this??


print '<table border=0><tr>'
print	'<td><b>Author:</b></td><td>' \
    	'<input ...>'

By using line continuation (\), python will automatically treat the two 
strings as one, just like an ANSI C compiler will.

Of course, it begs the question, why not just use:
print '<table border=0><tr>\n<td><b>Author:</b></td><td><input ...>'


More information about the Python-list mailing list