14 lines
458 B
Python
14 lines
458 B
Python
import os
|
|
|
|
resource_file = "resources.qrc"
|
|
image_folder = "images"
|
|
|
|
with open(resource_file, "w") as f:
|
|
f.write('<!DOCTYPE RCC><RCC version="1.0">\n<qresource prefix="">\n')
|
|
for root, _, files in os.walk(image_folder):
|
|
for file in files:
|
|
if file.endswith('.png'):
|
|
f.write(f' <file>{os.path.join(image_folder, file)}</file>\n')
|
|
f.write('</qresource>\n</RCC>\n')
|
|
|
|
print(f"{resource_file} has been generated.") |