printing - How do I keep Python print from adding newlines or spaces? -


this question has answer here:

in python, if say

print 'h' 

i letter h , newline. if

print 'h', 

i letter h , no newline. if say

print 'h', print 'm', 

i letter h, space, , letter m. how can prevent python printing space?

the print statements different iterations of same loop can't use + operator.

you can use:

sys.stdout.write('h') sys.stdout.write('m') 

Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -