thp / pyotherside

Python Bindings for Qt 5 and Qt 6. Allows you to access a CPython 3 interpreter directly from your Qt QML user interface code.
https://thp.io/2011/pyotherside/
Other
364 stars 49 forks source link

pyotherside does not import in Ubuntu 14.04 in a python file #43

Closed JeffHoogland closed 9 years ago

JeffHoogland commented 9 years ago

Apologies this is likely the wrong place to post this, but I do not see an IRC channel, forum, or mailing list listed for getting help with pyotherside. If there is one of the above please direct me there.

I am trying to work with pyotherside on Ubuntu 14.04 (version 1.2). When I add:

import io.thp.pyotherside 1.2

To my qml file it imports successfully.

However when I add:

import pyotherside

To a python file, it fails to import. Do I need to install something other than the pyotherside package on Ubuntu to access pyotherside from a python file?

zyga commented 9 years ago

I think the mistake you are making is that you are trying to import pyotherside from a regular python module.

Py_other_side swaps that idea around. Use QML and javascript to load any python module. That module (only when loaded from QML) can then see the special pyotherside module.

Have a look at pyotherside examples for some ... well, examples!

Best regards ZK

2015-04-07 22:05 GMT+02:00 Jeff Hoogland notifications@github.com:

Apologies this is likely the wrong place to post this, but I do not see an IRC channel, forum, or mailing list listed for getting help with pyotherside. If there is one of the above please direct me there.

I am trying to work with pyotherside on Ubuntu 14.04 (version 1.2). When I add:

import io.thp.pyotherside 1.2

To my qml file it imports successfully.

However when I add:

import pyotherside

To a python file, it fails to import. Do I need to install something other than the pyotherside package on Ubuntu to access pyotherside from a python file?

— Reply to this email directly or view it on GitHub https://github.com/thp/pyotherside/issues/43.

JeffHoogland commented 9 years ago

Doesn't it go in both directions? Look at this example here -> http://pyotherside.readthedocs.org/en/latest/#handling-asynchronous-events-from-python-in-qml

Am I misunderstanding that example about sending data from python code back to QML?

zyga commented 9 years ago

It does but you cannot run any of those by executing python3 and importing pyotherside.

2015-04-07 23:15 GMT+02:00 Jeff Hoogland notifications@github.com:

Doesn't it go in both directions? Look at this example here -> http://pyotherside.readthedocs.org/en/latest/#handling-asynchronous-events-from-python-in-qml

Am I misunderstanding that example about sending data from python code back to QML?

— Reply to this email directly or view it on GitHub https://github.com/thp/pyotherside/issues/43#issuecomment-90735126.

JeffHoogland commented 9 years ago

Ahh - so import pyotherside only works in a python file when that python file is called from QML?

zyga commented 9 years ago

Yes, exactly.

2015-04-07 23:31 GMT+02:00 Jeff Hoogland notifications@github.com:

Ahh - so import pyotherside only works in a python file when that python file is called from QML?

— Reply to this email directly or view it on GitHub https://github.com/thp/pyotherside/issues/43#issuecomment-90738085.

JeffHoogland commented 9 years ago

Thank you.