Using os.system() and string concatenation
steven.bethard at gmail.com
Tue Oct 12 22:15:57 CEST 2004
Wayne Witzel III <wwitzel3 <at> gmail.com> writes:
> No, I was properly inserting the spaces. When I changed it to a print
> statement and executed the resulting output, it worked just fine.
Not sure if I understand exactly what you said here, but just to be clear, the
print statement inserts spaces:
>>> x, y, z = 'x', 'y', 'z'
>>> print x, y, z
x y z
>>> x + y + z
>>> print x + y + z
>>> import sys
>>> sys.stdout.write(x + y + z)
So if you're saying the output of a print statement works, but the string
concatenation doesn't then yes, it does sound like you're not inserting spaces.
Could you put
print cmd + list1 + list1 + list2 + list3
at the end of your script and tell us what it outputs?
More information about the Python-list