The .start() method is overloaded so there is another form where you call it without arguments (or optionally pass the OpenModeFlag flag). That one doesn’t look to be deprecated. To use this you will need to set the program and arguments separately using the specific methods –
p = QProcess()
p.setProgram("python")
p.setArguments(['dummy_script.py'])
p.start()
Note that the arguments are passed as a list of strings.
Thanks @martin. Just wondering where did you find the latest API from the documentation? I tried to search from Qt Documentation but couldn’t find anything useful. I guess Qt documentation wasn’t up to date then?
It’s there in the Qt5 documentation, just easy to miss. Since .start() is an overloaded method it has multiple entries in the page. The links at the top of the page point to two variants –
On that same page you can see the setProgram and setArguments methods, which accept the program and arguments in the same format as the first form of .start().
I missed that first method actually (assumed it was the old one that was deprecated). But it’s not, so it looks like you could also do the following –
p = QProcess()
p.start("python", ['dummy_script.py'])