pyotherside 试用

pyotherside 试用

这是啥?
用python写qt


步骤:
安装qt: http://www.qt.io/download-open-source/#section-2
安装python3:
下载源代码 https://github.com/thp/pyotherside
编译 pyotherside:    他主页上有一个简短的说明
    qmake
    make
    make install
    
编译完可以执行个测试     ./tests/tests

 

运行example程序

F:\wamp\www\git_repos\GitHub\pyotherside>qmlscene F:\wamp\www\git_repos\GitHub\pyotherside\examples\helloworld.qml
qml: PyOtherSide version: 1.4.0
qml: Python version: 3.4.3
qml: python error: Not a parameter list in call to pyotherside.send:
"PyOtherSide error: No module named 'thismoduledoesnotexisthopefully'"
qml: python error: Cannot import module: thismoduledoesnotexisthopefully (No module named 'thismodul
edoesnotexisthopefully')
"PyOtherSide error: invalid syntax (<string>, line 1)"
qml: python error: Cannot evaluate '[ 123 [.syntax234-error!' (invalid syntax (<string>, line 1))
qml: Python module "os" is now imported
qml: python error: Not a parameter list in call to os.chdir:
qml: python error: Not a parameter list in call to os.listdir:
qml: files in /: undefined
qml: dir listing: .git,docs,examples,LICENSE,Makefile,pyotherside.pri,pyotherside.pro,python.pri,REA
DME,src,tests

关于pyotherside的视频:有什么特点,内部是怎样个原理, 怎样用
https://www.youtube.com/watch?v=2HAFOZ5_Xks

 

Q1: This application failed to start because it could not find or load the Qt platfo rm plugin "windows".

path F:\sw\Qt\Qt5.4.2\5.4\msvc2013_opengl\bin;F:\sw\Qt\Qt5.4.2\Tools\QtCreator\bin;

注意顺序!

 

Q2:file:///F:/wamp/www/git_repos/GitHub/pyotherside/examples/helloworld.qml:2 module "io.thp.pyotherside" is not installed

file:///F:/wamp/www/git_repos/GitHub/pyotherside/examples/helloworld.qml:2 module "io.thp.pyotherside" plugin "pyothersideplugin" not found

这是因为系统不知道这个plugin在哪里

执行 nmake install就可以

其实他是执行了这两条命令

copy /y "release\pyothersideplugin.dll" "F:\sw\Qt\Qt5.4.2\5.4\msvc2013_opengl\qml\io\thp\pyotherside\pyothersideplugin.dll"
copy /y F:\wamp\www\git_repos\GitHub\pyotherside\src\qmldir F:\sw\Qt\Qt5.4.2\5.4\msvc2013_opengl\qml\io\thp\pyotherside

而dmldir文件内容为

module io.thp.pyotherside
plugin pyothersideplugin

posted on 2015-06-13 20:49  cutepig  阅读(484)  评论(0编辑  收藏  举报

导航