Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to make executables with pyotherside? #89

Open
jozo opened this issue Nov 27, 2017 · 2 comments
Open

How to make executables with pyotherside? #89

jozo opened this issue Nov 27, 2017 · 2 comments

Comments

@jozo
Copy link

jozo commented Nov 27, 2017

Hi guys,

when working with PyQt we can use pyinstaller or similar apps to freeze python scripts and make one executable from them. How is it possible to create a executable for project that use pyotherside? Is there some tutorial? Goal is to create and distribute packages for different platforms (mac, linux, windows).

@toby20130333
Copy link

meet to

@alex-eri
Copy link

alex-eri commented May 19, 2020

Create C++ / QML project from template.

Add new python file to qml.qrc like backend/resources.py

Add some functions like def request(a): return 123+a

In main.qml add

import io.thp.pyotherside 1.5

and inside component

    Python {
        id: py
        Component.onCompleted: {
            addImportPath(Qt.resolvedUrl('qrc:/backend/'));
            importModule('resources',  function() {})
        }
    }

Then in interface

Button {
        onClicked: {
            py.call('resources.request', [234], function (result) {
                console.log(result)
            })
       }

}

Compile and run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants