How would you design a very “Pythonic” UI framework?

后端 未结 15 1826
日久生厌
日久生厌 2021-02-02 01:29

I have been playing with the Ruby library \"shoes\". Basically you can write a GUI application in the following way:

Shoes.app do
  t = para \"Not clicked!\"
  b         


        
15条回答
  •  悲哀的现实
    2021-02-02 01:34

    You could actually pull this off, but it would require using metaclasses, which are deep magic (there be dragons). If you want an intro to metaclasses, there's a series of articles from IBM which manage to introduce the ideas without melting your brain.

    The source code from an ORM like SQLObject might help, too, since it uses this same kind of declarative syntax.

提交回复
热议问题