We have moved to a new Sailfish OS Forum. Please start new discussions there.
1 | initial version | posted 2014-02-09 08:51:31 +0200 |
Hi, I can't get even the simpliest application to work with Sailfish and PyOtherSide. What i'm doing wrong? Is it with addImportPath? Here is the code:
pressbutton.qml
import QtQuick 2.0
import Sailfish.Silica 1.0
import io.thp.pyotherside 1.0
ApplicationWindow
{
initialPage: Page {
id: page
Button {
id: mybtn
text: "press"
anchors.centerIn: page
onClicked: {
py.call('pressbutton.pressme', function() {});
}
}
Python {
id: py
Component.onCompleted: {
addImportPath(Qt.resolvedUrl('/usr/share/pressbutton/qml'));
importModule('pressbutton', function() {});
}
}
}
cover: Qt.resolvedUrl("cover/CoverPage.qml")
}
and pressbutton.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def pressme():
f = open("/home/nemo/Documents/file.txt","a")
f.write("this is example text")
f.close()
2 | No.2 Revision |
Hi, I can't get even the simpliest application to work with Sailfish and PyOtherSide. What i'm doing wrong? Is it with addImportPath? Here is the code:
pressbutton.qml
import QtQuick 2.0
import Sailfish.Silica 1.0
import io.thp.pyotherside 1.0
ApplicationWindow
{
initialPage: Page {
id: page
Button {
id: mybtn
text: "press"
anchors.centerIn: page
onClicked: {
py.call('pressbutton.pressme', function() {});
}
}
Python {
id: py
Component.onCompleted: {
addImportPath(Qt.resolvedUrl('/usr/share/pressbutton/qml'));
importModule('pressbutton', function() {});
}
}
}
cover: Qt.resolvedUrl("cover/CoverPage.qml")
}
and pressbutton.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def pressme():
f = open("/home/nemo/Documents/file.txt","a")
f.write("this is example text")
f.close()
3 | No.3 Revision |
I can't get even the simpliest application to work with Sailfish and PyOtherSide. What i'm doing wrong? Is it with addImportPath? Here is the code:
pressbutton.qml
import QtQuick 2.0
import Sailfish.Silica 1.0
import io.thp.pyotherside 1.0
ApplicationWindow
{
initialPage: Page {
id: page
Button {
id: mybtn
text: "press"
anchors.centerIn: page
onClicked: {
py.call('pressbutton.pressme', function() {});
}
}
Python {
id: py
Component.onCompleted: {
addImportPath(Qt.resolvedUrl('/usr/share/pressbutton/qml'));
importModule('pressbutton', function() {});
}
}
}
cover: Qt.resolvedUrl("cover/CoverPage.qml")
}
and pressbutton.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pyotherside
def pressme():
f = open("/home/nemo/Documents/file.txt","a")
f.write("this is example text")
f.close()