N
N
Noortvel2018-07-11 12:45:54
Python
Noortvel, 2018-07-11 12:45:54

How to run exe with arguments from py script?

I have an .exe in the folder with the .py script, it processes some images that are in other folders. This requires os.system("command"). So what is the correct way to compose this cmd line if I need to pass some keys + there are spaces in the image path?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Burov, 2018-07-11
@Noortvel

os.system("command arg1 arg2")

import subprocess
subprocess.call(['command', 'arg1', 'arg2'])

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question