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))