No output file when running Python subprocess <p>I'm trying to run a SystemC (C++) executable in a Python script using subprocess.</p> <p>My issue is the following: my SystemC executable should generate an output file, but this is not happening. I'm sure of this because in the same Python script I call the subprocess I try to move the file that should be generated by my SystemC executable to another directory and always get the error:</p> <pre><code>IOError: [Errno 2] No such file or directory: '/home/jechiarelli/Dropbox/Mestrado/Codigos/Plataformas/tlmdt-traffic_genenerator/trace.vci' </code></pre> <p>Here's my code:</p> <pre><code>#!/usr/bin/python import os import sys import subprocess from shutil import move tgPath = '/home/jechiarelli/Dropbox/Mestrado/Codigos/Plataformas/tlmdt-traffic_genenerator/' sintSeriesPath = '/home/jechiarelli/Dropbox/Mestrado/Dados/series/aggregated_througput/sintetico/' vciPath = '/home/jechiarelli/Dropbox/Mestrado/Dados/vci/' tgExe = tgPath + 'simulation.x' tgOutput = tgPath + 'trace.vci' appName = sys.argv[1] inputs = [s for s in os.listdir(sintSeriesPath) if appName in s] for i in inputs: subprocess.call([tgExe, sintSeriesPath + i, i.split('agg')[-1]], shell = True) if 'mwm' in i: move(tgOutput, vciPath + 'tlmdt-tg-' + appName + '_mwm_' + i.split('agg')[-1] + '.vci') else: move(tgOutput, vciPath + 'tlmdt-tg-' + appName + '_arfima_' + i.split('agg')[-1] + '.vci') </code></pre> <p>Obs.: when I run the SystemC executable directly in the command line the output file is generated correctly. </p>