Python API & QT issue

Hi,

I’m tring to use the Python API for Trelis / Cubit
I do not know if I do it well

I run python in a terminal (Using Xubuntu 14.04) :

import cubit cubit.init('')

Is that right ?
cause after that, it leads to the error :

QObject::startTimer: QTimer can only be used with threads started with QThread QObject::startTimer: QTimer can only be used with threads started with QThread QObject::startTimer: QTimer can only be used with threads started with QThread QObject::startTimer: QTimer can only be used with threads started with QThread ...Interrupt Detected. CUBIT Exiting...
Have you solution to fix the issue, so I can run Cubit through a Python terminal ?
Thanks !

Try initializing cubit with an empty list (the cubit.init function requires a list). Instead of

cubit.init(’’)

try

cubit.init([’’])

When I try to do the init with an empty string on my Debian machine, python crashes. When I do it with the empty list in the second example, it imports fine.

fine, now it works
And just to be sure, there is no GUI launched when init is called ?

It will run the command line version of Trelis/Cubit.

If you want the GUI, probably your best bet would be to start Trelis like normal, then import the other python modules you want to use into Trelis’ python interpreter.

You can set the PYTHONPATH environment variable to the directory containing
your installation. For example

export PYTHONPATH=/usr/local/lib/python2.7/site-packages

Basically this means that the path to modules that you want to import needs to be included in the PYTHONPATH environment variable.

ok but where is the specific environnement file of CUBIT where I can edit the cubit PYTHONPATH ?