使用 pyside-uic 生成 Python 代码 [英] Python code generation with pyside-uic

查看:31
本文介绍了使用 pyside-uic 生成 Python 代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从 QtDesigner 文件生成 python 代码?我找到了 pyside-uic,但找不到语法示例.我用 spyder 运行 win7 和 pythonxy.

How can I generate python code from a QtDesigner file ? I found pyside-uic but I can't find an example for the syntax. I run win7 and pythonxy with spyder.

推荐答案

pyside-uic 或多或少与 pyuic4 相同,因此手册页指定:

pyside-uic is more or less identical to pyuic4, as such the man page specifies:

Usage:
        pyside-uic [options] <ui-file>

Options:
    --version
        show program's version number and exit

    -h,--help
        show this help message and exit

    -oFILE,--output=FILE
        write generated code to FILE instead of stdout

    -x,--execute
        generate extra code to test and display the class

    -d,--debug
        show debug output

    -iN,--ident=N
        set indent width to N spaces, tab if N is 0 (default: 4)

我通常这样使用它:

pyside-uic -o output.py input.ui

这篇关于使用 pyside-uic 生成 Python 代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆