You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
483 B
Python

import os
fileType = ['png', 'ico']
with open('{}Qrc.qrc'.format('static'), 'w') as f:
f.write(
'''<RCC>
<qresource prefix="/static">
''')
for root, dirs, files in os.walk('..\\static'):
for file in files:
if file.split('.')[-1] in fileType:
print(file)
f.write(' <file alias="{}">{}</file>\r\n'.format(file, os.path.join(root,file)))
f.write('''
</qresource>
</RCC>
''')
cmd = 'pyrcc5 -o {}.py {}Qrc.qrc'.format('static','static')
os.system(cmd)