ImportError: No module named qtdemo_rc

python-qt4-doc/examples problem

 

Q:"ImportError: No module named qtdemo_rc" when running pyqt demo.

A:

pyrcc4 -o qtdemo_rc.py qtdemo.qrc

 

Tips:

#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import os
import sys

if len(sys.argv) > 1:
    pth = sys.argv[1]
else:
    pth = '.'

for root, dirs, files in os.walk(pth):
    for f in files:
        if f.endswith('.qrc'):
            print('pyrcc4 -o %s/%s_rc.py %s/%s' % (root, f.rsplit('.', 1)[0], root, f))
posted on 2012-09-27 17:42  eshizhan  阅读(581)  评论(0编辑  收藏  举报