Stop spaces from appearing when printing to file

news.west.cox.net sean.berry2 at cox.net
Sun Nov 7 20:33:39 EST 2004


> The spaces are a feature of print. To avoid them, use string formatting to 
> create a single output string.
>
>> print >> x,';',object,";",AN_string,";",ascii,";",sum
>
> Try
> print >> x, ';%s;%s;%s;%s' % (object, AN_string, ascii, sum)
>
> Kent
>
or....

print x + ';' + object + ";" + AN_string + ";" + ascii + ";" + sum





More information about the Python-list mailing list