Files
bananaSPLIT/bananaSPLIT/UserInterface/compileUI.py

24 lines
688 B
Python

'''
Created on 24 nov 2019
@author: Emanuele Trabattoni
'''
import os, glob, subprocess
if __name__ == '__main__':
print(os.getcwd())
uifiles = glob.glob("*.ui")
for f in uifiles:
command = r"pyuic5.exe "+f
print(command)
rv = subprocess.run(command, capture_output=True)
fp = open(r".\compiledUI\\"+f.replace("ui","py"), 'w')
fp.write(str(rv.stdout, encoding='utf-8').replace('\r', ''))
fp.close()
command = r'pyrcc5.exe '+'resources/resources.qrc'
print (command)
rv = subprocess.run(command, capture_output=True)
fp = open(r".\compiledUI\\resources_rc.py", 'w')
fp.write(str(rv.stdout, encoding='utf-8').replace('\r', ''))
fp.close()
pass