Forum Archive

[Tip]Pyui files, view as a string

Phuket2

I am not sure if this was always the case or not (I have a feeling it wasn't) But at least in 1.6 if you have a .pyui file and rename it to a .py file, you see the string/dict representation in the editor. If you rename it back it to a .pyui file, works as expected.
Handy to know

ywangd

pyui files have always been plain JSON files. You can read them as any text files, open('myui.pyui').read(). It is the case in 1.5 as well.

Phuket2

@ywangd, sure. I just didn't think you could rename a existing .pyui file to .py before and have it show up in the editor correct.could be wrong, but it's a time saver

omz

Yep, that's new in 1.6 (unless you were using a script to rename the file). Btw, you get slightly better syntax highlighting if you use .json instead of .py as the file extension.

Phuket2

@omz, thanks. Nice to know. Is a nice feature. I know a small thing, but makes life easier