JeremyR
okay, I finally have time to learn python and I thought Id start with making basic UI for starters. Just looking around the web for ideas I came upon a small python script that uses a single class to define the whole window which calls itself and creates an instance of the window right at the end.

Is this standard practice? It looks pretty cool.
Reply 0 0
pshipkov
That's one way to do it.
Also a good idea is to keep the actual "doIt" code separated from the UI routines. So you always end up with code that can be called from command line and optional UI wrapper on top of it, etc.

Reply 0 0
JeremyR
I have some examples you showed me a while back when I was doing UIs in mel that I am using as my templates so I think I understand what you mean.
Except instead of the create window, UI wrapper and doit stuff in separate global procs as in mel, do you mean these become separate functions inside the same class? These in turn just call one another?
Reply 0 0
pshipkov
Yes.
For small to medium size things it is good to group everything into a single class. For bigger things you go python package.

Reply 0 0
JeremyR
Thanks Peter.
Reply 0 0
Reply