Menu

How to evaluate a script with a base class

2011-03-03
2013-04-06
  • Thomas Heimbächer

    Hello there

    We already succeeded in calling a python script.
    In the script "TestScript01.py" we defined a class TestScript.
    So we first evaluate the script by calling

    PythonQtObjectPtr mainModule = PythonQt::self()->getMainModule();
    mainModule->evalFile("TestScript01.py");
    PythonQtObjectPtr testClass = mainModule.evalScript("TestScript()\n", Py_eval_input);

    Now we changed our script. Our class TestScript inherits from a new class Test Base in file TestBase.py.

    When we start the system we now get

    "NameError"
    ": "
    "name 'TestBase' is not defined"

    What can we do to let PythonQt know about our new base class?
    I would be glad for any kind of help.

    Thank you very much
    Frank Thomas

     
  • superfisi

    superfisi - 2011-03-25

    Just a short hint: We reposted this issue in the Help-Forum. If anyone is interested in the answer… you can find it there. :)

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.