Monday, April 23, 2012

PyQt - QLabel and QGraphicsView

These two classes are different
For a quick display of images , QLabel is nicer with low system cost
But QGraphicsView is more flexible with functionls such as transform, multiItem display


Wednesday, April 11, 2012

Extend python with c -2

when using py2exe and pyinstaller 
several issues are found and listed here:
  1. py2exe supports relative directory to find the ini files in the ./conf folder, but pyinstaller use absolute path, and can only be run under the folder
  2. for the c extend module of python, the loading dll error is due to that the computer does not have NI imaq installed, it seems that when the module is load, it already starts to load the dll file, and the dll file starts to load the driver of the imaq hardware, as such, the error of dll initialization is due to the lack of the driver/hardware
  3. the c extend module (.pyd) relies on the OS version, e.g., build from 32 bit system won't work on build from 64 bit system. the error msg is sth like:

    %1 Is Not a Valid Win32 Application


Tuesday, April 10, 2012

Extending Python with C - 1

The idea of linking these two languages is that:
python args -> Parser -> c args
c output  -> Parser ->python objects

the  Parser is written in C. and a Wrapper C program is needed to call the Parser and link python with C