공식 문서를 보고 Pyside2-uic.exe .\mainwindow.ui > mainwindow.py 와 같이 변환을 했더니, 파일 앞에 null char가 붙어서 나온다. PyCharm으로 실행하면 다음과 같은 에러가 뜸.
source code string cannot contain null bytes…
검색해본 결과, py 파일이 FF FE로 시작하고 있으며 이건 UTF파일 포맷을 표시하는 방식이다. 근데 인식을 못하는거네? ㅋ
UTF 파일 포맷 BOM( Byte Order Mark) :
http://blog.wystan.net/2007/08/18/bom-byte-order-mark-problem
해결책은 리디렉션 파이프같은거 쓰지말고 그냥 ‘-o’ 로 아웃풋 옵션을 쓰면 깔끔.
>pyside2-uic.exe .\mainwindow.ui -o mainwindow.py