How to get rid of the space after 'print',?
Gary Herron
gherron at aw.sgi.com
Thu Feb 10 19:10:08 EST 2000
More information about the Python-list mailing list
Thu Feb 10 19:10:08 EST 2000
- Previous message (by thread): OT Re: Fully Bracketed Syntax
- Next message (by thread): How to get rid of the space after 'print',?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Peter Bittner wrote: > > Hi there! > > I'm writing HTML-code with the print statement as follows: > > 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?? > Easy, write to stdout directly: import sys sys.stdout.write(SomeString) This writes out the bytes of the string exactly, nothing more, nothing less. No following spaces, no line-ends, and no conversion from other types, just (binary) byte strings. Gary. -- Dr. Gary Herron <gherron at aw.sgi.com> 206-287-5616 Alias | Wavefront 1218 3rd Ave, Suite 800, Seattle WA 98101
- Previous message (by thread): OT Re: Fully Bracketed Syntax
- Next message (by thread): How to get rid of the space after 'print',?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list