Reading python script and store as string at compile time?
Solved
General and Desktop
-
I'm using C++ version of Qt, I want to read some python script and store them as strings at compile time. I tried copy and pasting them into the cpp file and read them as raw string literal. It works but since python script is space sensitive, they looks so ugly when pasted in a cpp file
QString pythonScript = R"(import abc as apple print("1") def = "hello")";
Is there better ways to do this?
-
Hi
You could use a resource file and store a .py file there and load it.