PyQt leaves C-code in python modules

Dave shuvit at 127.0.0.1
Tue Nov 4 22:12:57 CET 2003


"Phil Thompson" <phil at riverbankcomputing.co.uk> wrote in message
news:mailman.439.1067973360.702.python-list at python.org...
> On Tuesday 04 November 2003 6:45 pm, Dave wrote:
> > I'm having a strange problem with the pyqt-tools in the latest Debian
> > packages.  When I run
> > $ pyuic colortool.ui > colortool.py
> > Extracting init()
> > Extracting loadSettings()
> > Extracting saveSettings()
> > ...
> > it produces 'colortool.py' with python function headers, but the body of
> > the functions are still in C.  There are no error messages, just the
normal
> > log of "extracting" functions.
> >
[...]
> That's because the form includes embedded C++ code. There is nothing to
stop
> you embedding Python code (just ignore the C++ style function definition)
and
> it will be properly extracted.
>
> What pyuic doesn't do is look at the embedded code and try to work out if
it
> is Python or something else.

OK, I can ignore the C++ embedded code, but it seems that Python can't.

Python 2.3.2 (#2, Oct  6 2003, 08:02:06)
[GCC 3.3.2 20030908 (Debian prerelease)] on linux2
>>> from colortool import MainForm
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "colortool.py", line 225
    QSettings settings;
                     ^
SyntaxError: invalid syntax


I must be missing a switch or something.



-- Dave








More information about the Python-list mailing list