Your issue is with string formatting. Read the tutorial to know how to do the basic formatting.
If all items are strings, you could just concatenate the strings (+
):
import subprocess
reply = int(raw_input("Enter 1, 2 or 3: "))
for item in [itroom, second, csupport][reply - 1]:
subprocess.check_call([r'c:\delprof2\DelProf2.exe', '/l', '/c:' + item])
Note: if you want all subprocesses to run concurrently then you could use Popen
directly:
import subprocess
reply = int(raw_input("Enter 1, 2 or 3: "))
commands = [[r'c:\delprof2\DelProf2.exe', '/l', '/c:' + item]
for item in [itroom, second, csupport][reply - 1]]
# start child processes in parallel
children = map(subprocess.Popen, commands)
# wait for processes to complete, raise an exception if any of subprocesses fail
for process, cmd in zip(children, commands):
if process.wait() != 0: # failed
raise subprocess.CalledProcessError(process.returncode, cmd)