The Mer Wiki now uses your Mer user account and password (create account on https://bugs.merproject.org/)


Sailfish/Python Development

From Mer Wiki
< Sailfish
Revision as of 19:49, 23 May 2014 by Xerxes2 (Talk | contribs)

Jump to: navigation, search

Contents

Python 2

Python 2.7 is provided in the "jolla" repository, and can be installed using pkcon:

pkcon install python

Python 3

Starting with Sailfish OS 1.0.3.8, Python 3.3.3 and PyOtherSide are shipped in the official repositories.

pkcon install python3-base

Python and Qt 5

There are different options for developing Python Qt 5 apps on Sailfish OS:

  • PyOtherSide: In official repositories, supports Qt 5 and Python 3. Will be supported in Harbour.
  • PyQt: Available from OpenRepos.net, supports Qt 5.
  • PySide: Not in official repositories or OpenRepos, as it doesn't support Qt 5 yet. If you need PySide-style bindings, use PyQt.


PyOtherSide (POS)

PyOtherSide homepage | PyOtherSide on github

Starting with Sailfish OS 1.0.3.8, PyOtherSide is now available in the official repos.

The PyOtherSide QML plugin can be installed directly without adding any addition repos using pkcon:

pkcon install pyotherside-qml-plugin-python3-qt5

PyQt

PyQt homepage | PyQt for Sailfish OS on OpenRepos.net


PyQt can be installed by adding the sailfish_lib repo:

ssu addrepo sailfish_lib http://sailfish.openrepos.net/sailfish_lib/personal/main
ssu updaterepos
pkcon refresh sailfish_lib

For Python2:

pkcon install pyqt

For Python3:

pkcon install python-pyqt

POS vs PyQt

Coding

POS is a QML plugin which means that you'll have to start your program from a few lines of C++ code and from your QML code you import the POS plugin and from there you import your Python modules. PyQt basically is a 1:1 glue layer for the Qt C++ API so you just use it as you would use any other Python module. If all you need from Qt is QML then you could happily stick to POS, if you need more than that then you would need to use PyQt.

License

POS is distributed under non copy-left conditions which means that your code could use any license you like. PyQt is distributed under the GPL3 license so your code must use that license too or buy a commercial license from Riverbank Computing.

Publishing

POS applications you can publish on Openrepos without having to deal with third party repos. And Harbour will accept POS apps in a not so distand future. PyQt will probably never be accepted in Harbour so Openrepos is your only option for now.

Software

Using PyOtherSide :

Using PyQt :

Links


  1. TMO: xerxes2 packages PyQt for Sailfish OS
Personal tools