Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
pyui render - view .pyui files on PC
-
Hey guys. I was annoyed of not having a tool which allows you to view
.pyui
files on PC so I thought about creating one :).It is a python script, which will parse
.pyui
file (which is basicallyjson
file) and then generate HTML file which can be viewed in the browser such as Firefox, Safari, etc.It is still dirty and surely not complete yet. Program supports
View
,Label
andTextField
elements (hopefully). Gonna try to add more elements tomorrow after school. Please post your reviews and ideas here or open issues on the github page :].Repository: https://github.com/Vik2015/pyui-renderer/
-
@ShadowSlayer Very cool, can't wait to check it out.
-
Pprint actually works pretty well. I tend to think of pyuis as just a repr of a dict. You can read pyuis and eval them, and pprint shows the structure well. This can be useful,for, for instance moving a bunch of components into some container, or flattening a view that had subviews.
from pprint import pprint def showpyui(filename): with open(filename) as f: s=f.read() # safe eval. Pyuis have literals true and false instead of True and False, so we have to fix those by defining appropriate locals pyuidict=eval(s,{'__builtins__':None},{'true':True,'false':False}) pprint(pyuidict)