Using os.system() and string concatenation

From: Wayne Witzel III (wwitzel3_at_gmail.com)
Date: 10/12/04


Date: Tue, 12 Oct 2004 11:43:28 -0700
To: Python Mailing List <python-list@python.org>

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[0] + list1[1] + list2[0] + list3[0])

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.

Thanks,

Wayne



Relevant Pages

  • Re: c# definitive explantion of dotnet JIT compilation please and how to speed up performace
    ... Points to improve initial load time: ... look carefully at what code actually executes during startup; ... might be able to "async" some of it and display something ... loop, can be the life saver; note that for short lists (say, <150, but ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Using os.system() and string concatenation
    ... > I think take those lists and provide them to an os.systemcall. ... > This executes without any errors, but doesn't execute the command ... > supply it to os.systemit executes just fine. ... a shell command out of data from files, ...
    (comp.lang.python)
  • Make Rterm98 respond very fast !!
    ... executes and lists the register details. ... But,The buffer size is quite big. ... I tried clearing the buffer and Execute the commands, ...
    (microsoft.public.vc.debugger)
  • Re: [ANNOUNCE] udev 015 release
    ... forking and earning SIGCHLDS for manipulating the global lists. ... It executes our current udev in the background and delays the execution ... If we decide not to stay with the threads model, ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: why cannot assign to function call
    ... I'm going to follow up here at the risk of annoying Mark, ... helpful in explaining things to Python beginners. ... it becomes a namespace mapping names to objects. ... to the list itself, while Steven held that Python lists ...
    (comp.lang.python)