(PyQt4) How to covert *.ui to*.py?

2,473 views
Skip to first unread message

Dai-Chang Yang

unread,
Oct 14, 2013, 11:08:47 PM10/14/13
to python_in...@googlegroups.com
After saving ui by Qt designer ,I want to convert the *.ui to *.py.

And I found this from google but it's not work.

from PyQt4 import QtGui,QtCore, uic

pyuic4 '*.ui' -o '*.py'

Can anyone help me? THANKS.

Panupat Chongstitwattana

unread,
Oct 15, 2013, 1:18:22 AM10/15/13
to python_in...@googlegroups.com
pyuic4 and pyrcc4 are exe command. You run them via command/dos prompt.

I don't think wild card works, you'll probably need to type the file names.

Justin Israel

unread,
Oct 15, 2013, 1:50:40 AM10/15/13
to python_in...@googlegroups.com
And if you are using PySide its:   pyside-uic   and   pyside-rcc


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/b1633aef-211d-4629-9da6-fba0d5e2cdd1%40googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

Sascha Kremers

unread,
Oct 15, 2013, 1:52:29 AM10/15/13
to python_in...@googlegroups.com
It seems like you are mixing up two things: 
pyuic4 '*.ui' -o '*.py'
Should be run from the terminal, depending on your installation you have to put an absolute path to the pyuic4 command. 
After that you can import the created python file. 
Reference:


from PyQt4 import QtGui,QtCore, uic
The uic module you can import in python on the other hand allows you to dynamically compile the .ui file, with uic.loadUiType(designerfile.ui). 

Nathan Horne has written a nice introduction to this:

-- 
Sascha Kremers
Gesendet mit Sparrow

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages