Issues with GPT via Python's subprocess.run()

I think the problem is that you’ve put both the parameter name and parameter in separate portions of the list, which puts a space between each. You’ll need to concatenate the parameter name and the parameter in each list item of subprocess.run,

subprocess.run(["gpt", graph_preprocess, "-Pinputproduct=" + product_selected_path, "-Pvectorfile=" + vector_filepath, "-Poutputproduct=" + os.path.join(output_dir, outfn_preprocessed)], stdout=subprocess.PIPE)
1 Like