Print function and spaces

Bjoern Paschen paschen at mavd.de
Thu Feb 5 09:09:34 EST 2004


On Thu, 05 Feb 2004 11:38:26 +0000, Dan Williams wrote:

> Is there a good way to stop the space being automatically generated, or am I
> going to have to write a blank string to standard output, like the manual
> mentions?
I don't know if these are good ways, but i found this information about
the topic on google:
http://www-106.ibm.com/developerworks/library/l-python101.html?dwzone=ws
 "The part about concatenation is important here"

http://www.faqts.com/knowledge_base/view.phtml/aid/4465
 "How to turn off the automatic space completely"

and i tried to implement the concatenation part into a small function
(beware as i am new to python too ;)):

---snip----
#/usr/bin/env python

def PrintWithoutSpaces(*args):
    output = ""
    for i in args:
        output = output + i
        
    print output
    

if __name__ == "__main__":
    PrintWithoutSpaces("yo", "hello", "gutentag")
---snip----

this prints "yohellogutentag"

-- 
_________________________________________________________________
Bjoern Paschen         ._--_. Panasonic AVC Networks Germany GmbH
paschen at mavd.de          --   Audio Video Technology Centre





More information about the Python-list mailing list