Keith Devens .com |
Monday, December 1, 2008 | ![]() |
| All non-trivial abstractions, to some degree, are leaky. – Joel Spolsky (The Law of Leaky Abstractions) | ||
|
| ← Awesome episode of Angel | Regex coach → |

Adam Vandenberg wrote:
Matt Croydon (http://postneo.com) wrote:
A language rules when pseudocode works.
Keith (http://www.keithdevens.com/) wrote:
Awesome, thanks Adam. I knew the trick about the comma after the print statement, but I was surprised when it still put spaces around everything.
Simon Willison (http://simon.incutio.com/) wrote:
Don't forget Python's bult in printf style support:
print "Hello, %s, check this out." % 'simon'
Feel free to post a comment below. Please see my comment policy.
Formatting Rules (No HTML):
Generated in about 0.285s.
(Used 8 db queries)

You don't.
Print is a special keyword, not a function or method, and will always rpint a newline or space after itself.
Some people consider this a language wart.
If you want to output with no extra whitespace, it's
sys.stdout.write(some string expression)
Or
write = sys.stdout.write
write(some string expression)