Should I learn wxPython code or XRC code?

653 Views Asked by At

After some research I've decided to use wxWidgets to build user interfaces for my Python programs. I learnt this could be done in two ways: either I blend my "behind the scenes" raw Python code with interface related wxPython code, or I could separate the interface from the main code, creating a separated XRC file for the interface and just calling it in the main Python code. What should I do, should I learn wxPython or should I learn XRC code?

I read some advantages of learning/using XRC:

  • Separates the interface from the program logic.
  • Dialog Blocks only outputs to C++ and XRC, not for Python.
  • Ability to choose between different resource files at run time.
  • XRC is a wxWidgets standard, so it can be generated and processed by any program that understands it.
  • XML is easier to parse than most programming languages.

But I think there are some disadvantages too:

  • Documentation seems a lot bigger for wxPython.
  • More people seems to learn and talk about wxPython, so support for. XRC may be scarce

So, what would be the best to learn, XRC code or wxPython code?

1

There are 1 best solutions below

1
On BEST ANSWER

You should learn wxPython. XRC does have its advantages, but it only covers the core widgets. If you want access to the rest of wxPython, then you'll have to figure out how to make XRC wrap the unsupported widgets, which is non-trivial and will require you to learn wxPython anyway.

There are tons of wxPython tutorials, but only a few XRC tutorials. I've written about both, but I usually stick with wxPython code.