Using os.system() and string concatenation
Wayne Witzel III
wwitzel3 at gmail.com
Tue Oct 12 20:43:28 CEST 2004
Using Python 2.3
Currently I process three files and build the output of those files in
to lists using for statements.
I think take those lists and provide them to an os.system() call.
cmd = "/usr/sbin/useradd"
os.system(cmd + list1 + list1 + list2 + list3)
This executes without any errors, but doesn't execute the command
supplied to os.system(). Now if I place them all in cmd first, then
supply it to os.system() it executes just fine. So there really isn't
a problem, just wanting to know what would cause such behavior.
More information about the Python-list