How to call a Python script in a C++ code in Qt Creator?

Asked

Viewed 534 times

3

How do I call a Python script in a C++ code in Qt Creator?

  • Please, I would like some example. I thank you in advance!!

  • Have you researched the subject? If you found something, edit the question with what you found.

  • I searched, but could not call a python script. I still accept suggestions.

1 answer

2

Based in that reply, the way to call any python script by Qt is:

QProcess p;
p.start("python", "script.py");

Remember that it is necessary to have python in the Path of the machine.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.